Logo

LoaderExceptions when building in Release mode – sgen.exe

June 14, 2012
1 min read

Recently we faced a problem where an application would build and run in debug mode but it would not do the same in release, throwing the following error at the end of a build. sgen = http://msdn.microsoft.com/en-us/library/bk3w6240(v=VS.100).aspx Knowing that sgen is responsible for generating the xml serialisation assembly for the application, the error was most likely related to an assembly that was injected during runtime into the AppDomain, in release mode.