After changing the output directory of a visual studio project it started to fail to build with an error very much like:
C:\\Program Files\\Microsoft Visu
If you are having this problem while building your VS.NET project in Release mode here is the solution:
Go to the project properties and click on the Build tab and set the value of the "Generate Serialization Assembly" dropdown to "Off".
Sgen.exe is "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." (MSDN)