Why does MSBuild put *.XmlSerializers.dll assembly in the root folder of published web application

asp.netmsbuildxml-serialization

I have a build process which takes my VS 2008 .NET 2.0 ASP.NET project and builds it using MSBuild. The project contains ASPX files, plus a web service, and also connects to another web service 😉

All seems to work well except MSBuild puts the *.XmlSerializers.dll assembly file into the folder _PublishedWebsites\MySite rather than in _PublishedWebsites\MySite\bin like it does with the other dll.

Does it matter that the *.XmlSerializers.dll assembly file is not in the bin folder?

Or should I use my build process to copy the *.XmlSerializers.dll assembly into the bin folder after MSBuild has finished?

Best Answer

You don't need this assembly unless you will be serializing and deserializing types from your assembly. This assembly is generated by the compiler to save your application from having to generate it once it is up and running.

If you intend on doing serialization, keep the assembly as it will help with performance. If you don't intend on doing any serialization then feel free to ignore it or remove it altogether.

For more information about this practice please see XML Serializer Generator Tool:

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.