Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jul 16, 2025

This PR obsoletes the XsltSettings.EnableScript property with diagnostic ID SYSLIB0062 to help users migrating from .NET Framework to modern .NET.

Background

XSLT Script blocks are supported only in .NET Framework and are not supported on .NET Core or .NET 5+. The EnableScript property has no legitimate value on modern .NET:

  • When set to false: simply skips script blocks (expected behavior anyway)
  • When set to true: throws PlatformNotSupportedException (script compilation not supported)

Obsoleting this API turns a runtime error into a build warning, providing better guidance for migration.

Changes Made

  • Added obsoletion constants to src/libraries/Common/src/System/Obsoletions.cs
  • Added [Obsolete] attribute to EnableScript property in both source and reference assemblies
  • Added pragma warnings to suppress obsoletion warnings in internal library code
  • Updated diagnostic documentation with SYSLIB0062
  • Added SYSLIB0062 to NoWarn list for facade assemblies

Example

var settings = new XsltSettings();
settings.EnableScript = true; // Now generates SYSLIB0062 warning

The warning message: XSLT Script blocks are not supported on .NET Core or .NET 5 or later.

Testing

  • All existing tests pass and show expected obsoletion warnings
  • Library builds successfully with no errors
  • Internal usage properly suppressed with pragma warnings
  • No breaking changes - this is a warning-only change

Fixes #108287.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI changed the title [WIP] [API Proposal]: Obsolete XsltSettings.EnableScript Obsolete XsltSettings.EnableScript with SYSLIB0062 Jul 16, 2025
Copilot AI requested a review from jeffhandley July 16, 2025 08:08
Copilot finished work on behalf of jeffhandley July 16, 2025 08:08
@jeffhandley
Copy link
Member

Failures are known and unrelated

@tarekgh tarekgh added this to the 10.0.0 milestone Jul 17, 2025
Copy link
Member

@tarekgh tarekgh left a comment

Choose a reason for hiding this comment

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

LGTM!

@ericstj ericstj added the breaking-change Issue or PR that represents a breaking API or functional change over a prerelease. label Jul 17, 2025
@dotnet-policy-service dotnet-policy-service bot added the needs-breaking-change-doc-created Breaking changes need an issue opened with https://github.com/dotnet/docs/issues/new?template=dotnet label Jul 17, 2025
@dotnet-policy-service

This comment was marked as resolved.

Copilot AI requested a review from tannergooding July 17, 2025 18:44
Copilot finished work on behalf of tannergooding July 17, 2025 18:44

This comment was marked as resolved.

Copilot AI requested a review from jeffhandley July 17, 2025 19:35
Copilot finished work on behalf of jeffhandley July 17, 2025 19:35

This comment was marked as resolved.

Copilot finished work on behalf of jeffhandley July 17, 2025 20:06
@jeffhandley
Copy link
Member

jeffhandley commented Jul 21, 2025

[Breaking change]: System.Xml.Xsl.XsltSettings.EnableScript Property marked as Obsolete (dotnet/docs#47504) created to document the breaking change. Skipping the email notification to the breaking changes distribution list since the property didn't have any functioning behavior previously.

@jeffhandley jeffhandley removed the needs-breaking-change-doc-created Breaking changes need an issue opened with https://github.com/dotnet/docs/issues/new?template=dotnet label Jul 21, 2025
@jeffhandley
Copy link
Member

/ba-g Failures are timeouts in unrelated tests

@jeffhandley jeffhandley merged commit 40e90f3 into main Jul 22, 2025
82 of 89 checks passed
@jeffhandley jeffhandley deleted the copilot/fix-108287 branch July 22, 2025 05:57
@github-actions github-actions bot locked and limited conversation to collaborators Aug 21, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-System.Xml breaking-change Issue or PR that represents a breaking API or functional change over a prerelease.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[API Proposal]: Obsolete XsltSettings.EnableScript

5 participants