Share via


Unable to load one or more of the requested types - How to retrieve LoaderExceptions property for more info?

Question

Monday, August 1, 2016 6:29 PM

This issue does not occur when I build debug, but only when I switch to release I get this message: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information. This isn't terribly helpful to me. The suggestions I read include wrapping code in try/catch blocks and catching LoaderExceptions, but I'm getting this error on build, not at runtime. 

All replies (1)

Monday, August 1, 2016 9:08 PM âś…Answered

It turned out that I had to turn off assembly serialization in the csproj file of the web project. Running the solution in debug worked without the fix, but release yielded the error I mentioned. I never did get the LoaderException property for more information. I found a class online that was supposed to help out by comparing assembly short names with full names, but it either failed in this case or I didn't know how to find the problem.