VIA ligAZ blog
A Blog to Remember
"sgen.exe" exited with code 1
If you are having this problem while building your VS.NET 2005 project in Release mode here is the solution:
Go to the project properties. Click on the build tab and set the value of the "Generate Serialization Assembly" dropdown to Off.
P.S. If you wonder for what is this sgen.exe here is explanation from the msdn: "The XML Serializer Generator creates an XML serialization assembly for types in a specified assembly in order to improve the startup performance of a XmlSerializer when it serializes or deserializes objects of the specified types.".