Search code examples
visual-studio-2013buildsgen

Project won't build under custom configuration - SGEN error


Visual Studio 2013.

I have a solution that builds under Release and Debug configurations (with all project configurations set appropriately to Release and Debug). I have added a custom configuration called "Staging" and set only the web app startup project to this configuration (all other dependencies are still set to Debug).

When I try to build the web app I get...

SGEN : error : Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.

If I switch the web app project configuration back to Debug it works. I have removed the Staging config from the web app and recreated it based on the Debug config but still have the error.

I've been stuck on this for 3 hours so any help is much appreciated.

Just to clarify, the Staging configuration is exactly the same as the Debug configuration except the startup web app is using a Staging config. This config has been deleted and recreated based upon the Debug config.


Solution

  • I found an answer here...

    http://hashtagfail.com/post/5255977780/sgen-loaderexceptions-error

    Debugging SGEN didn't reveal anything, but I disabled xml serialization since it appears it's only useful for Release builds.