DEV Community

Serge van den Oever
Serge van den Oever

Posted on

Fixing "sgen.exe" filename or extension is too long

When you build a C# project in Visual Studio and get the error Error MSB6003 The specified task executable "sgen.exe" could not be run. System.ComponentModel.Win32Exception (0x80004005): The filename or extension is too long you can fix it by going to the properties of the C# project, and on the Build tab set the Generate serialization assembly to off.

Apply this setting to both the Debug and Release configuration, otherwise it works locally (Debug), but fails on your build server (Release).

See XML Serializer Generator Tool (Sgen.exe) for more information on the tooling.

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more