Tuesday, April 06, 2010

Error: “sgen.exe” exited with code 1

In VS 2005, it is building the solution in "Debug" mode correctly. But, when i try to build the solution in "Release" mode i got the error "'sgen.exe' exited with code 1".

Solution:

  1. Open the GAC (C:\Windows\Assembly), find the DLL corresponding to your project.
  2. Right click on it and select uninstall.
  3. Now, re-build your project and the problem must be gone.