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
Microsoft XML Serializer Generator - .NET
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.
Microsoft XML Serializer Generator - .NET
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.
2 Replies
I'm confused, so if I have a reference Microsoft.XmlSerializer.Generator and created the *.Xmlserializer.dlls, do I still need the Microsoft.XmlSerializer.Generator packages?
Conclusion: this package is flawed, or SDK style projects are flawed. I can not use an SDK style projet without using this nuget package to create my serializers
Here's a write up:
Stack Overflow
Microsoft.XmlSerializer.Generator nuget package and .NET Framework
I have a .net framework project that needs to be build The Project.XmlSerializers.dll. It was using the old style csproj file format and I converted to the new SDK style project. I then added the