File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -57,10 +57,13 @@ public void AddRegistration(IResourceTypeRegistration registration)
5757 throw new InvalidOperationException ( String . Format ( "The type `{0}` has already been registered." ,
5858 registration . Type . FullName ) ) ;
5959
60- if ( _registrationsByName . ContainsKey ( registration . ResourceTypeName ) )
60+ IResourceTypeRegistration existingRegistration ;
61+ if ( _registrationsByName . TryGetValue ( registration . ResourceTypeName , out existingRegistration ) )
6162 throw new InvalidOperationException (
62- String . Format ( "The resource type name `{0}` has already been registered." ,
63- registration . ResourceTypeName ) ) ;
63+ String . Format ( "Could not register `{0} under resource type name `{1}` because `{1}` has already been registered by `{2}`." ,
64+ registration . Type . FullName ,
65+ registration . ResourceTypeName ,
66+ existingRegistration . Type . FullName ) ) ;
6467
6568 _registrationsByType . Add ( registration . Type , registration ) ;
6669 _registrationsByName . Add ( registration . ResourceTypeName , registration ) ;
You can’t perform that action at this time.
0 commit comments