1

I have a C# Class Library project targeting .NET FW 4.7.2. Every time I compile the project, it also generates a file MyProject.XmlSerializers.dll. I'm pretty sure this is ok and it is needed for XML serialization. But I want to know why it creates it and if there is some project setting to adjust this.

huha
  • 4,053
  • 2
  • 29
  • 47
  • 1
    Those are [Microsoft XML Serializer Generator](https://learn.microsoft.com/en-us/dotnet/core/additional-tools/xml-serializer-generator) assemblies a.k.a [`Sgen.exe`](https://learn.microsoft.com/en-us/dotnet/standard/serialization/xml-serializer-generator-tool-sgen-exe) assemblies that might have or might not been created at the time the project was built. See [Generating an Xml Serialization assembly as part of my build](https://stackoverflow.com/q/134224) for a discussion of how they are enabled (and disabled). – dbc Jan 17 '23 at 15:47
  • 2
    Project > Properties > Build tab, "Generate serialization assembly" = Off. – Hans Passant Jan 17 '23 at 16:08

1 Answers1

0

Thanks to dbc & HansPassant. Both comments help.

Turning Project > Properties > Build tab, "Generate serialization assembly" off skips the Sgen.exe during the build process. Turning it On or Auto enables it. Sgen.exe is the part that generates the serialization assembly.

huha
  • 4,053
  • 2
  • 29
  • 47