C#C
C#11mo ago
Cyclomatic

Using Microsoft.XmlSerializer.Generator issues

Hi,

I have an old .net project that I build as a nuget package. It's targetting .net 4.8. I modified the .csproj file to use the modern .NET SDK style project and I use "dotnet build"/"dotnet pack" to build or build a nuget package.

I modified my .csproj to use the Microsoft.XmlSerializer.Generator package as per this: https://learn.microsoft.com/en-us/dotnet/core/additional-tools/xml-serializer-generator

mainly because I had issues getting the *.XmlSerializer.dlls built.

I build the nuget package and it looks good.

I then reference the nuget package from a .net 4.8 console app where I haven't converted the .csproj to .net SDK style (I can't assume that every consumer has or can do this!). I get the following warning:

warning MSB3073: The command "dotnet Microsoft.XmlSerializer.G
enerator "obj\Debug\ConsoleApp22.exe" --force --quiet obj\Debug\sgen.rsp" exited with code 1.

warning : SGEN: Failed to generate the serializer for ConsoleA
pp22.exe. Please follow the instructions at https://go.microsoft.com/fwlink/?linkid=858594 and try again.

Any ideas how I can work around this?? Now that *.XmlSerializers.dll are not being built
An overview of the Microsoft XML Serializer Generator. Use the XML Serializer Generator to generate an XML serialization assembly for the types contained in your project.
An overview of the Microsoft XML Serializer Generator. Use the XML Serializer Generator to generate an XML serialization assembly for the types contained in your project.
Was this page helpful?