I was having trouble building a solution in VIsual Studio 2005 and I was getting the following error. "sgen.exe" exited with code 1 I found that following the steps below fixed it: Open up the project properties. Open up the build tab. Set "Generate Serialization Assembly" to "Off"