You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Update samples to use latest NuGet package reference and to include a notation that the latest version is always recommended.
Would also be helpful to include a subsection that describes how to use Xml Serializer Generator in projects that are multi-targeting net48 and net5.0 on projects that are in a hybrid state while migrating.
I believe this can be accomplished using a csproj similar to:
Addressing the multi-target scenario could help to explain how to resolve build errors that look like the following:
17>------ Build started: Project: ExampleProject, Configuration: Release Any CPU ------
17>SGEN : error : An attempt was made to load an assembly with an incorrect format: C:\dev\.nuget\packages\system.memory\4.5.1\ref\netstandard2.0\System.Memory.dll.
17>Done building project "ExampleProject.csproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
ID: cb8026b7-96b0-eab2-e6ec-93d9c61e95e6
Version Independent ID: 1ed6e1bf-7228-608d-b3fa-fa517e55386e
The "An attempt was made to load an assembly with an incorrect format" error, caused by the .NET Framework SGEN trying to load a reference assembly, can also occur when targeting .NET Framework and referencing a NuGet package that includes a reference assembly. This has been discussed in dotnet/msbuild#2707, dotnet/wcf#3991, and dotnet/sdk#1630. I don't think the article should recommend adding conditions that check $(TargetFramework). Rather, it should recommend using the Microsoft.XmlSerializer.Generator package on all target frameworks.
#28844 added documentation for SGenReferences and other properties. However, the article currently recommends Microsoft.XmlSerializer.Generator 1.0.0, which ignores all of those properties. Microsoft.XmlSerializer.Generator 2.1.0-preview4.19212.13 is the first version that supports those properties. The article should be changed to recommend Microsoft.XmlSerializer.Generator 2.1.0 or a higher version, or to describe which versions support the properties.
Update samples to use latest NuGet package reference and to include a notation that the latest version is always recommended.
Would also be helpful to include a subsection that describes how to use Xml Serializer Generator in projects that are multi-targeting net48 and net5.0 on projects that are in a hybrid state while migrating.
I believe this can be accomplished using a csproj similar to:
Addressing the multi-target scenario could help to explain how to resolve build errors that look like the following:
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
The text was updated successfully, but these errors were encountered: