castleproject / Windsor

Castle Windsor is a best of breed, mature Inversion of Control container available for .NET
http://www.castleproject.org
Apache License 2.0
1.52k stars 455 forks source link

When a type load fails, Windsors throws a NullReferenceException as opposed to a TypeLoadException #560

Open balintn22 opened 4 years ago

balintn22 commented 4 years ago

I just hit this problem recently: When calling DiContainer.Resolve(), I received a NullReferenceException, and took quite some time to figure out why. It turned out that my installer failed to copy one of my .dlls.

In a similar case the .Net Framework throws a more specific TypeLoadException, which would have been helpful in this case too.

Castle.Core version: 4.4.1 Castle.Windsor version: 5.0.1 .Net Framework 4.5.2

generik0 commented 3 years ago

@balintn22 can you please provide a sample project with the error for replication?