Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the benefit of turning Generate Serialization Assemblies off?

The Generate Serialization Assemblies option in Visual Studio creates a MyAssembly.XmlSerializers.dll when my project is built. This question (https://stackoverflow.com/questions/934411/what-is-myassembly-xmlserializers-dll-generated-for) indicates a reason why it's there in the first place, and some of the answers provide ways to turn it off, but my question is why would you choose to turn it off? Does having it turned on cause problems in certain situations (and, if so, what are those situations)?

like image 616
m-smith Avatar asked May 31 '12 10:05

m-smith


People also ask

What does generate serialization Assembly do?

The serialization assembly improves the startup performance of a XmlSerializer when it serializes or deserializes objects of the specified types.

What is Xmlserializers?

The XmlSerializer enables you to control how objects are encoded into XML.

What is Sgen EXE?

XML Serializer Generator Tool. This 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. These assemblies can then be deployed with your application.


2 Answers

Only problems you might be facing are with build tools - such as msbuild, because if you use sgen from x32 SDK on assembly that is explicitly x64 it will raise a build-time error (you can easily overcome this by setting correct SGenToolPath path to msbuild or target MSIL instead). IMHO it is better to deal with build time issues and have quicker startup time.

like image 90
Ondrej Svejdar Avatar answered Nov 16 '22 00:11

Ondrej Svejdar


Turning it off stopped the build and run time errors I was getting as a result of upgrading my application to v4.0. I was getting SGEN errors after trying many of the solutions posted online. Doing this solved that issue.

like image 31
Marcel Avatar answered Nov 16 '22 01:11

Marcel