Forcing Visual Studio to produce an XML Serializers DLL
A friend needed the Xml Serializers dll, the one named something like “ClassLibrary1.XmlSerializers.dll”, so he went into the project properties in VS and set “Build > Generate serialization assembly” to “On”. But nothing happened. No XmlSerializers dll was created.
We hunted round for an answer and came across this: Generating an Xml Serialization assembly as part of my build.
After setting the above project property you must go into the project file in your favorite text editor and add this:
just after the line:
You should end up with something like this:
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <DebugSymbols>true</DebugSymbols> <DebugType>full</DebugType> <Optimize>false</Optimize> <OutputPath>bin\Debug\</OutputPath> <DefineConstants>DEBUG;TRACE</DefineConstants> <ErrorReport>prompt</ErrorReport> <WarningLevel>4</WarningLevel> <GenerateSerializationAssemblies>On</GenerateSerializationAssemblies> <SGenUseProxyTypes>false</SGenUseProxyTypes> </PropertyGroup>
Do that for every build configuration where you need the serializer.
Hope that helps.