Skip to content

Disable serialization assembly generation#3542

Open
mlsomers wants to merge 1 commit intomono:mainfrom
mlsomers:patch-1
Open

Disable serialization assembly generation#3542
mlsomers wants to merge 1 commit intomono:mainfrom
mlsomers:patch-1

Conversation

@mlsomers
Copy link

@mlsomers mlsomers commented Mar 3, 2026

Prevent Sgen from trying to load reference assemblies when used in projects that use legacy Xml serialization.

Description of Change

Added GenerateSerializationAssemblies tag with "off" to the main project

Bugs Fixed

A common issue with legacy projects using Xml serialization:
dotnet/msbuild#2707

Sgen generates code so that the runtime no longer needs to use reflection in order to serialize or deserialize xml, speeding up serialization considerably. Adding a reference to SkiaSharp breaks the feature.

API Changes

None.

Behavioral Changes

None.

Required skia PR

None.

PR Checklist

  • Has tests (if omitted, state reason in description)
    It has no runtime side effects, just prevents a compiletime error for some projects
  • Rebased on top of main at time of PR
  • Merged related skia PRs
    No related PR found
  • Changes adhere to coding standard
  • Updated documentation
    Nothing needs to change

Prevent Sgen from trying to load reference assemblies when used in projects that use legacy Xml serialization.
@dotnet-policy-service
Copy link
Contributor

Hey there @@mlsomers! Thank you so much for your PR! Someone from the team will get assigned to your PR shortly and we'll get it reviewed.

@mlsomers
Copy link
Author

mlsomers commented Mar 3, 2026

@dotnet-policy-service agree

@mattleibow
Copy link
Contributor

/azp run

@mattleibow mattleibow requested a review from Copilot March 6, 2026 18:33
@azure-pipelines
Copy link

No pipelines are associated with this pull request.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Disables MSBuild SGen serialization assembly generation for the core SkiaSharp library project to avoid build-time failures in legacy XmlSerializer workflows that can occur when reference assemblies are present.

Changes:

  • Set GenerateSerializationAssemblies to Off in binding/SkiaSharp/SkiaSharp.csproj.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

3 participants