© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•13mo ago•
4 replies
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
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
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
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources
Was this page helpful?

Similar Threads

Recent Announcements

Similar Threads

❔ Microsoft.XmlSerializer.Generator causes failure to load assembly System.Runtime
C#CC# / help
3y ago
issues with code generator
C#CC# / help
10mo ago
Creating and using an incremental source generator
C#CC# / help
4y ago
Using ` Microsoft.Extensions.DependencyInjection` in a library
C#CC# / help
4mo ago