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
Copy file name to clipboardExpand all lines: docs/core/compatibility/core-libraries/10.0/obsolete-apis.md
+6-1Lines changed: 6 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
title: "Breaking change: .NET 10 obsoletions with custom IDs"
3
3
titleSuffix: ""
4
4
description: Learn about the APIs that have been marked as obsolete in .NET 10 with a custom diagnostic ID.
5
-
ms.date: 03/28/2025
5
+
ms.date: 09/08/2025
6
6
ai-usage: ai-assisted
7
7
---
8
8
# API obsoletions with non-default diagnostic IDs (.NET 10)
@@ -21,6 +21,7 @@ The following table lists the custom diagnostic IDs and their corresponding warn
21
21
|[SYSLIB0059](../../../../fundamentals/syslib-diagnostics/syslib0059.md)|<xref:Microsoft.Win32.SystemEvents.EventsThreadShutdown?displayProperty=nameWithType> callbacks aren't run before the process exits. Use <xref:System.AppDomain.ProcessExit?displayProperty=nameWithType> instead. | Warning |
22
22
|[SYSLIB0060](../../../../fundamentals/syslib-diagnostics/syslib0060.md)|<xref:System.Security.Cryptography.Rfc2898DeriveBytes?displayProperty=nameWithType> constructors are obsolete. Use <xref:System.Security.Cryptography.Rfc2898DeriveBytes.Pbkdf2*?displayProperty=nameWithType> instead. | Warning |
23
23
|[SYSLIB0061](../../../../fundamentals/syslib-diagnostics/syslib0061.md)|<xref:System.Linq.Queryable.MaxBy``2(System.Linq.IQueryable{``0},System.Linq.Expressions.Expression{System.Func{``0,``1}},System.Collections.Generic.IComparer{``0})?displayProperty=nameWithType> and <xref:System.Linq.Queryable.MinBy``2(System.Linq.IQueryable{``0},System.Linq.Expressions.Expression{System.Func{``0,``1}},System.Collections.Generic.IComparer{``0})?displayProperty=nameWithType> taking an `IComparer<TSource>` are obsolete. Use the new ones that take an `IComparer<TKey>`. | Warning |
24
+
|[SYSLIB0062](../../../../fundamentals/syslib-diagnostics/syslib0062.md)|<xref:System.Xml.Xsl.XsltSettings.EnableScript?displayProperty=nameWithType> is obsolete. | Warning |
24
25
25
26
## Version introduced
26
27
@@ -64,6 +65,10 @@ These obsoletions can affect [source compatibility](../../categories.md#source-c
Copy file name to clipboardExpand all lines: docs/core/compatibility/unsupported-apis.md
+2-1Lines changed: 2 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
title: Unsupported APIs on .NET Core and .NET 5+
3
3
titleSuffix: ""
4
4
description: Learn which .NET APIs always throw an exception on .NET Core and .NET 5 and later versions.
5
-
ms.date: 11/22/2024
5
+
ms.date: 09/08/2025
6
6
---
7
7
# APIs that always throw exceptions on .NET Core and .NET 5+
8
8
@@ -349,6 +349,7 @@ This article organizes the affected APIs by namespace.
349
349
|<xref:System.Xml.XmlDictionaryReader.CreateMtomReader(System.Byte[],System.Int32,System.Int32,System.Text.Encoding[],System.String,System.Xml.XmlDictionaryReaderQuotas,System.Int32,System.Xml.OnXmlDictionaryReaderClose)?displayProperty=nameWithType>| All |
350
350
|<xref:System.Xml.XmlDictionaryReader.CreateMtomReader(System.IO.Stream,System.Text.Encoding[],System.String,System.Xml.XmlDictionaryReaderQuotas,System.Int32,System.Xml.OnXmlDictionaryReaderClose)?displayProperty=nameWithType>| All |
351
351
|<xref:System.Xml.XmlDictionaryWriter.CreateMtomWriter(System.IO.Stream,System.Text.Encoding,System.Int32,System.String,System.String,System.String,System.Boolean,System.Boolean)?displayProperty=nameWithType>| All |
352
+
|<xref:System.Xml.Xsl.XsltSettings.EnableScript?displayProperty=nameWithType> (when set to `true`) | All |
Copy file name to clipboardExpand all lines: docs/fundamentals/code-analysis/quality-rules/ca3076.md
+7-5Lines changed: 7 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,18 +17,17 @@ f1_keywords:
17
17
18
18
## Cause
19
19
20
-
If you execute Extensible Stylesheets Language Transformations (XSLT) in .NET applications insecurely, the processor may resolve untrusted URI references that could disclose sensitive information to attackers, leading to Denial of Service and Cross-Site attacks. For more information, see [XSLT Security Considerations(.NET Guide)](../../../standard/data/xml/xslt-security-considerations.md).
20
+
If you execute Extensible Stylesheets Language Transformations (XSLT) in .NET applications insecurely, the processor might resolve untrusted URI references that could disclose sensitive information to attackers, leading to denial of service and cross-site attacks. For more information, see [XSLT Security Considerations(.NET Guide)](../../../standard/data/xml/xslt-security-considerations.md).
21
21
22
22
## Rule description
23
23
24
-
**XSLT** is a World Wide Web Consortium (W3C) standard for transforming XML data. XSLT is typically used to write style sheets to transform XML data to other formats such as HTML, fixed-length text, comma-separated text, or a different XML format. Although prohibited by default, you may choose to enable it for your project.
24
+
*XSLT* is a World Wide Web Consortium (W3C) standard for transforming XML data. XSLT is typically used to write style sheets to transform XML data to other formats such as HTML, fixed-length text, comma-separated text, or a different XML format. Although prohibited by default, you might choose to enable it for your project.
25
25
26
26
To ensure you're not exposing an attack surface, this rule triggers whenever the XslCompiledTransform.<xref:System.Xml.Xsl.XslCompiledTransform.Load%2A> receives insecure combination instances of <xref:System.Xml.Xsl.XsltSettings> and <xref:System.Xml.XmlResolver>, which allows malicious script processing.
27
27
28
28
## How to fix violations
29
29
30
-
- Replace the insecure XsltSettings argument with XsltSettings.<xref:System.Xml.Xsl.XsltSettings.Default%2A> or with an instance that has disabled document function and script execution.
31
-
30
+
- Replace the insecure `XsltSettings` argument with <xref:System.Xml.Xsl.XsltSettings.Default?displayProperty=nameWithType> or with an instance that's disabled document function and script execution.
32
31
- Replace the <xref:System.Xml.XmlResolver> argument with null or an <xref:System.Xml.XmlSecureResolver> instance.
33
32
34
33
## When to suppress warnings
@@ -150,6 +149,9 @@ namespace TestNamespace
150
149
}
151
150
```
152
151
152
+
> [!NOTE]
153
+
> Starting in .NET 10, the <xref:System.Xml.Xsl.XsltSettings.EnableScript%2A> property is marked as obsolete and generates warning `SYSLIB0062`. On .NET (Core), it's no longer necessary to explicitly set this property to `false` since script execution isn't supported.
Copy file name to clipboardExpand all lines: docs/fundamentals/syslib-diagnostics/obsoletions-overview.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -82,6 +82,7 @@ The following table provides an index to the `SYSLIB0XXX` obsoletions in .NET 5+
82
82
|[SYSLIB0059](syslib0059.md)| Warning |<xref:Microsoft.Win32.SystemEvents.EventsThreadShutdown?displayProperty=nameWithType> callbacks aren't run before the process exits. Use <xref:System.AppDomain.ProcessExit?displayProperty=nameWithType> instead. |
83
83
|[SYSLIB0060](syslib0060.md)| Warning | Constructors on <xref:System.Security.Cryptography.Rfc2898DeriveBytes?displayProperty=nameWithType> are obsolete. Use <xref:System.Security.Cryptography.Rfc2898DeriveBytes.Pbkdf2%2A?displayProperty=nameWithType> instead. |
84
84
|[SYSLIB0061](syslib0061.md)| Warning | The `Queryable`<xref:System.Linq.Queryable.MaxBy``2(System.Linq.IQueryable{``0},System.Linq.Expressions.Expression{System.Func{``0,``1}},System.Collections.Generic.IComparer{``0})?displayProperty=nameWithType> and <xref:System.Linq.Queryable.MinBy``2(System.Linq.IQueryable{``0},System.Linq.Expressions.Expression{System.Func{``0,``1}},System.Collections.Generic.IComparer{``0})?displayProperty=nameWithType> taking an `IComparer<TSource>` are obsolete. Use the new ones that take an `IComparer<TKey>`. |
85
+
|[SYSLIB0062](syslib0062.md)| Warning |<xref:System.Xml.Xsl.XsltSettings.EnableScript?displayProperty=nameWithType> is obsolete. |
Copy file name to clipboardExpand all lines: docs/fundamentals/syslib-diagnostics/syslib0061.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@ ms.date: 03/31/2025
5
5
f1_keywords:
6
6
- SYSLIB0061
7
7
---
8
-
# SYSLIB0061: System.Linq.Queryable.MaxBy and System.Linq.Queryable.MinBy taking an IComparer\<TSource\> are obsolete.
8
+
# SYSLIB0061: System.Linq.Queryable.MaxBy and System.Linq.Queryable.MinBy taking an IComparer\<TSource\> are obsolete
9
9
10
10
Starting in .NET 10, the two extension methods <xref:System.Linq.Queryable.MaxBy``2(System.Linq.IQueryable{``0},System.Linq.Expressions.Expression{System.Func{``0,``1}},System.Collections.Generic.IComparer{``0})?displayProperty=fullName> and <xref:System.Linq.Queryable.MinBy``2(System.Linq.IQueryable{``0},System.Linq.Expressions.Expression{System.Func{``0,``1}},System.Collections.Generic.IComparer{``0})?displayProperty=fullName> that accept an `IComparer<TSource>` are obsolete. Please use the newly added overloads that accept an `IComparer<TKey>` instead.
title: SYSLIB0062 warning - XsltSettings.EnableScript is obsolete
3
+
description: Learn about the obsoletion of the XsltSettings.EnableScript property. Use of this property generates compile-time warning SYSLIB0062.
4
+
ms.date: 09/08/2025
5
+
f1_keywords:
6
+
- SYSLIB0062
7
+
---
8
+
# SYSLIB0062: XsltSettings.EnableScript is obsolete
9
+
10
+
Starting in .NET 10, the <xref:System.Xml.Xsl.XsltSettings.EnableScript?displayProperty=nameWithType> property is marked obsolete.
11
+
12
+
## Reason for obsoletion
13
+
14
+
XSLT script blocks aren't supported on .NET (Core). Previously, if you set the property to `true`, a <xref:System.PlatformNotSupportedException> was thrown at run time. This obsoletion turns a run-time error into a build warning, which provides better guidance for migration.
15
+
16
+
## Workaround
17
+
18
+
Review call sites for any assumptions made about the behavior of this property. You can likely remove any references to the property since it didn't truly enable script blocks on modern .NET.
19
+
20
+
## Suppress a warning
21
+
22
+
If you must use the obsolete API, you can suppress the warning in code or in your project file.
23
+
24
+
To suppress only a single violation, add preprocessor directives to your source file to disable and then re-enable the warning.
25
+
26
+
```csharp
27
+
// Disable the warning.
28
+
#pragmawarningdisable SYSLIB0062
29
+
30
+
// Code that uses obsolete API.
31
+
// ...
32
+
33
+
// Re-enable the warning.
34
+
#pragmawarningrestore SYSLIB0062
35
+
```
36
+
37
+
To suppress all the `SYSLIB0062` warnings in your project, add a `<NoWarn>` property to your project file.
38
+
39
+
```xml
40
+
<ProjectSdk="Microsoft.NET.Sdk">
41
+
<PropertyGroup>
42
+
...
43
+
<NoWarn>$(NoWarn);SYSLIB0062</NoWarn>
44
+
</PropertyGroup>
45
+
</Project>
46
+
```
47
+
48
+
For more information, see [Suppress warnings](obsoletions-overview.md#suppress-warnings).
Copy file name to clipboardExpand all lines: docs/standard/data/xml/script-blocks-using-msxsl-script.md
+16-22Lines changed: 16 additions & 22 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,21 +7,24 @@ dev_langs:
7
7
- "vb"
8
8
ms.assetid: fde6f43f-c594-486f-abcb-2211197fae20
9
9
---
10
-
# Script Blocks Using msxsl:script
10
+
# Script blocks Using msxsl:script
11
11
12
12
> [!NOTE]
13
13
> Script blocks are supported only in .NET Framework. They are _not_ supported on .NET Core or .NET 5 or later.
14
14
15
15
The <xref:System.Xml.Xsl.XslCompiledTransform> class supports embedded scripts using the `msxsl:script` element. When the style sheet is loaded, any defined functions are compiled to common intermediate language (CIL) by the Code Document Object Model (CodeDOM) and are executed during run time. The assembly generated from the embedded script block is separate than the assembly generated for the style sheet.
16
16
17
-
## Enable XSLT Script
17
+
## Enable XSLT script
18
18
19
-
Support for embedded scripts is an optional XSLT setting on the <xref:System.Xml.Xsl.XslCompiledTransform> class. Script support is disabled by default. To enable script support, create an <xref:System.Xml.Xsl.XsltSettings> object with the <xref:System.Xml.Xsl.XsltSettings.EnableScript%2A> property set to `true` and pass the object to the <xref:System.Xml.Xsl.XslCompiledTransform.Load%2A> method.
19
+
Support for embedded scripts is an optional XSLT setting on the <xref:System.Xml.Xsl.XslCompiledTransform> class. Script support is disabled by default. To enable script support, create an <xref:System.Xml.Xsl.XsltSettings> object with the <xref:System.Xml.Xsl.XsltSettings.EnableScript%2A> property set to `true` and pass the object to the <xref:System.Xml.Xsl.XslCompiledTransform.Load%2A> method.
20
+
21
+
> [!WARNING]
22
+
> Starting in .NET 10, the <xref:System.Xml.Xsl.XsltSettings.EnableScript%2A> property is marked as obsolete and generates warning SYSLIB0062. Since script blocks aren't supported on .NET Core or .NET 5+, this property has no effect and setting it to `true` throws a <xref:System.PlatformNotSupportedException> at run time.
20
23
21
24
> [!NOTE]
22
25
> XSLT scripting should be enabled only if you require script support and you are working in a fully trusted environment.
23
26
24
-
## msxsl:scriptElement Definition
27
+
## msxsl:scriptelement definition
25
28
26
29
The `msxsl:script` element is a Microsoft extension to the XSLT 1.0 recommendation and has the following definition:
27
30
@@ -46,25 +49,25 @@ The <xref:System.Xml.Xsl.XslCompiledTransform> class supports embedded scripts u
46
49
</msxsl:script>
47
50
```
48
51
49
-
## Script Functions
52
+
## Script functions
50
53
51
54
Functions can be declared within the `msxsl:script` element. When a function is declared, it is contained in a script block. Style sheets can contain multiple script blocks, each operating independent of the other. That means that if you are executing inside a script block, you cannot call a function that you defined in another script block unless it is declared to have the same namespace and the same scripting language. Because each script block can be in its own language, and the block is parsed according to the grammar rules of that language parser we recommend that you use the correct syntax for the language in use. For example, if you are in a Microsoft C# script block, use the C# comment syntax.
52
55
53
56
The supplied arguments and return values to the function can be of any type. Because the W3C XPath types are a subset of the common language runtime (CLR) types, type conversion takes place on types that are not considered to be an XPath type. The following table shows the corresponding W3C types and the equivalent CLR type.
54
57
55
-
|W3C type|CLR type|
56
-
|--------------|--------------|
57
-
|`String`|<xref:System.String>|
58
-
|`Boolean`|<xref:System.Boolean>|
59
-
|`Number`|<xref:System.Double>|
60
-
|`Result Tree Fragment`|<xref:System.Xml.XPath.XPathNavigator>|
CLR numeric types are converted to <xref:System.Double>. The <xref:System.DateTime> type is converted to <xref:System.String>. <xref:System.Xml.XPath.IXPathNavigable> types are converted to <xref:System.Xml.XPath.XPathNavigator>. **XPathNavigator[]** is converted to <xref:System.Xml.XPath.XPathNodeIterator>.
64
67
65
68
All other types throw an error.
66
69
67
-
### Importing Namespaces and Assemblies
70
+
### Import namespaces and assemblies
68
71
69
72
The <xref:System.Xml.Xsl.XslCompiledTransform> class predefines a set of assemblies and namespaces that are supported by default by the `msxsl:script` element. However, you can use classes and members belonging to a namespace that is not on the predefined list by importing the assembly and namespace in `msxsl:script` block.
70
73
@@ -73,9 +76,7 @@ The <xref:System.Xml.Xsl.XslCompiledTransform> class supports embedded scripts u
73
76
The following two assemblies are referenced by default:
74
77
75
78
- System.dll
76
-
77
79
- System.Xml.dll
78
-
79
80
- Microsoft.VisualBasic.dll (when the script language is VB)
80
81
81
82
You can import the additional assemblies using the `msxsl:assembly` element. This includes the assembly when the style sheet is compiled. The `msxsl:assembly` element has the following definition:
@@ -97,19 +98,12 @@ The <xref:System.Xml.Xsl.XslCompiledTransform> class supports embedded scripts u
97
98
The following namespaces are included by default:
98
99
99
100
- System
100
-
101
101
- System.Collection
102
-
103
102
- System.Text
104
-
105
103
- System.Text.RegularExpressions
106
-
107
104
- System.Xml
108
-
109
105
- System.Xml.Xsl
110
-
111
106
- System.Xml.XPath
112
-
113
107
- Microsoft.VisualBasic (when the script language is VB)
114
108
115
109
You can add support for additional namespaces using the `namespace` attribute. The attribute value is the name of the namespace.
0 commit comments