Skip to content

Commit 692d3f5

Browse files
authored
Merge pull request #11012 from MicrosoftDocs/main638911370741931633sync_temp
Repo sync for protected branch
2 parents 174fa88 + b96bd26 commit 692d3f5

File tree

7 files changed

+33
-20
lines changed

7 files changed

+33
-20
lines changed

docs/code-quality/analyzers-faq.yml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
### YamlMime:FAQ
22
metadata:
33
title: EditorConfig versus analyzers
4-
ms.date: 10/05/2021
4+
ms.date: 08/15/2025
55
description: Learn about .NET Compiler Platform-based code analysis in Visual Studio. See answers to questions about EditorConfig files, rule sets, and other topics.
66
ms.topic: faq
77
helpviewer_keywords:
@@ -30,23 +30,25 @@ sections:
3030
answer: |
3131
Rule sets and EditorConfig files can coexist and can both be used to configure analyzers. Both EditorConfig files and rule sets let you enable and disable rules and set their severity.
3232
33-
However, EditorConfig files offer additional ways to configure rules too:
33+
However, in Visual Studio 2019 version 16.5 and later, rule set files are deprecated in favor of EditorConfig files, and .NET Core and .NET 5+ projects don't support all the rule set menu commands. For more information, see [Convert an existing rule set file to an EditorConfig file](../code-quality/use-roslyn-analyzers.md#convert-an-existing-rule-set-file-to-an-editorconfig-file).
34+
35+
EditorConfig files offer additional ways to configure rules:
3436
3537
- For the .NET code-quality analyzers, EditorConfig files let you [define which types of code to analyze](/dotnet/fundamentals/code-analysis/code-quality-rule-options).
36-
- For the .NET code-style analyzers that are built into Visual Studio, EditorConfig files let you [define the preferred code styles](/dotnet/fundamentals/code-analysis/code-style-rule-options) for a codebase.
38+
- For the .NET code-style analyzers and .NET code-quality analyzers, EditorConfig files let you [define the preferred code styles](/dotnet/fundamentals/code-analysis/code-style-rule-options) for a codebase.
3739
3840
In addition to rule sets and EditorConfig files, some analyzers are configured through the use of text files marked as [additional files](../ide/build-actions.md#build-action-values) for the C# and VB compilers.
3941
4042
> [!NOTE]
4143
> - EditorConfig files can only be used to enable rules and set their severity in Visual Studio 2019 version 16.3 and later.
42-
> - EditorConfig files cannot be used to configure legacy analysis, whereas rule sets can.
44+
> - EditorConfig files can't be used to configure legacy analysis, whereas rule sets can.
4345
4446
- name: Code analysis in continuous integration (CI) builds
4547
questions:
4648
- question: |
4749
Does .NET Compiler Platform-based code analysis work in continuous integration (CI) builds?
4850
answer: |
49-
Yes. For analyzers that are installed from a NuGet package, those rules are [enforced at build time](roslyn-analyzers-overview.md#build-errors), including during a CI build. Analyzers used in CI builds respect rule configuration from both rule sets and EditorConfig files. Currently, the code analyzers that are built into Visual Studio are not available as a NuGet package, and so these rules are not enforceable in a CI build.
51+
Yes. For analyzers that are installed with .NET SDK 5.0 or higher, or from a NuGet package, those rules are [enforced at build time](roslyn-analyzers-overview.md#build-errors), including during a CI build. Analyzers used in CI builds respect rule configuration from both rule sets and EditorConfig files. Starting with .NET 5.0, the code style analyzers that are built into Visual Studio are also included in the .NET SDK, and most of them are enforceable in a CI build. For more information, see [Enable on build](/dotnet/fundamentals/code-analysis/overview?tabs=net-9#enable-on-build).
5052
5153
- name: IDE analyzers versus StyleCop
5254
questions:
@@ -69,7 +71,7 @@ sections:
6971
- question: |
7072
What's the difference between FxCop analyzers and .NET analyzers?
7173
answer: |
72-
Both FxCop analyzers and .NET analyzers refers to the .NET Compiler Platform ("Roslyn") analyzer implementations of FxCop CA rules. Prior to Visual Studio 2019 16.8 and .NET 5.0, these analyzers shipped as `Microsoft.CodeAnalysis.FxCopAnalyzers` [NuGet package](https://www.nuget.org/packages/Microsoft.CodeAnalysis.FxCopAnalyzers). Starting in Visual Studio 2019 16.8 and .NET 5.0, these analyzers are [included with the .NET SDK](/dotnet/fundamentals/code-analysis/overview). They are also available as `Microsoft.CodeAnalysis.NetAnalyzers` [NuGet package](https://www.nuget.org/packages/Microsoft.CodeAnalysis.NetAnalyzers). Please consider [migrating from FxCop analyzers to .NET analyzers](migrate-from-fxcop-analyzers-to-net-analyzers.md).
74+
Both FxCop analyzers and .NET analyzers refers to the .NET Compiler Platform ("Roslyn") analyzer implementations of FxCop CA rules. Prior to Visual Studio 2019 16.8 and .NET 5.0, these analyzers shipped as `Microsoft.CodeAnalysis.FxCopAnalyzers` [NuGet package](https://www.nuget.org/packages/Microsoft.CodeAnalysis.FxCopAnalyzers). Starting in Visual Studio 2019 16.8 and .NET 5.0, these analyzers are [included with the .NET SDK](/dotnet/fundamentals/code-analysis/overview). They're also available as `Microsoft.CodeAnalysis.NetAnalyzers` [NuGet package](https://www.nuget.org/packages/Microsoft.CodeAnalysis.NetAnalyzers). Please consider [migrating from FxCop analyzers to .NET analyzers](migrate-from-fxcop-analyzers-to-net-analyzers.md).
7375
7476
- name: Treat warnings as errors
7577
questions:

docs/code-quality/in-source-suppression-overview.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ The properties of the attribute include:
194194

195195
- [`module`](#module-suppression-scope): This scope suppresses warnings against an assembly. It's a global suppression that applies to the entire project.
196196

197-
- `resource`: ([Legacy FxCop](../code-quality/static-code-analysis-for-managed-code-overview.md) only) This scope suppresses warnings in diagnostic info written to resource files that are part of the module (assembly). This scope isn't read or respected in C#/VB compilers for Roslyn analyzer diagnostics, which only analyze source files.
197+
- `resource`: ([legacy analysis](../code-quality/static-code-analysis-for-managed-code-overview.md) only) This scope suppresses warnings in diagnostic info written to resource files that are part of the module (assembly). This scope isn't read or respected in C#/VB compilers for Roslyn analyzer diagnostics, which only analyze source files.
198198

199199
- `type`: This scope suppresses warnings against a type.
200200

@@ -222,7 +222,7 @@ If there are strict performance reasons for minimizing in-source suppression met
222222

223223
For maintainability reasons, omitting the rule name isn't recommended.
224224

225-
### Suppress selective violations within a method body
225+
### Suppress selective violations within a method body (legacy analysis only)
226226

227227
Suppression attributes can be applied to a method, but can't be embedded within a method body. All violations of a particular rule are suppressed if you add the <xref:System.Diagnostics.CodeAnalysis.SuppressMessageAttribute> attribute to the method.
228228

docs/code-quality/roslyn-analyzers-overview.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ Visual Studio includes a core set of Roslyn analyzers, which are always active.
7373

7474
### Scope
7575

76-
If you install an analyzer as a NuGet package, the preferred method, it applies only to the project where the NuGet package is installed. Otherwise, if you install an analyzer as a Visual Studio extension, it applies at the solution level and to all instances of Visual Studio. In team environments, an analyzer you install as a NuGet package is in scope for all developers that work on that project.
76+
If you install an analyzer as a NuGet package, the preferred method for external analyzers, it applies only to the project where the NuGet package is installed. Otherwise, if you install an analyzer as a Visual Studio extension, it applies at the solution level and to all instances of Visual Studio. In team environments, an analyzer you install as a NuGet package is in scope for all developers that work on that project.
7777

7878
> [!NOTE]
7979
> First-party analyzers ship within the .NET SDK. It's preferable that you enable these analyzers from the .NET SDK instead of installing them as a `Microsoft.CodeAnalysis.NetAnalyzers` [NuGet package](https://www.nuget.org/packages/Microsoft.CodeAnalysis.NetAnalyzers). Enabling the analyzers from the .NET SDK ensures that you automatically get analyzer bug fixes and new analyzers as soon as you update the SDK. For more information about analyzers, see [Enable or install first-party .NET analyzers](install-net-analyzers.md).
@@ -92,7 +92,7 @@ The following screenshot shows the command-line build output from building a pro
9292

9393
### Rule severity
9494

95-
If you want to configure [analyzer rule severity](../code-quality/use-roslyn-analyzers.md#configure-severity-levels), you must install the analyzer as a NuGet package. You can't configure rule severity from analyzers that were installed as a Visual Studio extension.
95+
If you want to configure [analyzer rule severity](../code-quality/use-roslyn-analyzers.md#configure-severity-levels) for external analyzers, you must install the analyzer as a NuGet package. You can't configure rule severity from analyzers that were installed as a Visual Studio extension.
9696

9797
## Next steps
9898

16.8 KB
Loading
11.6 KB
Loading

docs/ide/reference/remove-unused-references.md

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Remove unused references
33
description: Learn how to clean up project references and NuGet packages that have no usage with the new Remove Unused References command.
4-
ms.date: 3/6/2024
4+
ms.date: 8/15/2025
55
ms.topic: reference
66
author: mikadumont
77
ms.author: midumont
@@ -31,20 +31,30 @@ This refactoring applies to:
3131

3232
1. Verify that the option is enabled.
3333

34-
Select **Tools** > **Options** > **Text Editor** > **C#** > **Advanced**, and enable **Show "Removed Unused References" command in Solution Explorer (experimental)**.
34+
Select **Tools** > **Options** > **Text Editor** > **C#** > **Advanced**, and enable **Show "Removed Unused References" command in Solution Explorer**.
3535

36-
1. Right click on a project name or dependencies node in Solution Explorer.
36+
1. In Solution Explorer, right click on a project name or the **Dependencies** node.
3737

3838
1. Select **Remove Unused References**.
3939

40-
![Remove Unused References command](media/remove-unused-references-command.png)
40+
::: moniker range=">= vs-2022"
41+
![Screenshot of Remove Unused References command.](media/vs-2022/remove-unused-references-command.png)
42+
::: moniker-end
43+
::: moniker range="vs-2019"
44+
![Screenshot of Remove Unused References command.](media/remove-unused-references-command.png)
45+
::: moniker-end
4146

42-
1. The **Remove Unused References** dialog will open displaying references that have no usage in source code. Unused references will be pre-selected for removal with an option to preserve references by selecting `Keep` from the Action drop down.
47+
1. The **Remove Unused References** dialog opens, displaying references that have no usage in source code. Unused references are pre-selected for removal with an option to preserve references by selecting `Keep` from the Action drop down.
4348

44-
![Remove Unused References dialog](media/remove-unused-references-dialog.png)
49+
::: moniker range=">= vs-2022"
50+
![Screenshot of Remove Unused References dialog.](media/vs-2022/remove-unused-references-dialog.png)
51+
::: moniker-end
52+
::: moniker range="vs-2019"
53+
![Screenshot of Remove Unused References dialog.](media/remove-unused-references-dialog.png)
54+
::: moniker-end
4555

4656
1. Click `Apply` to remove selected references.
4757

4858
## See also
4959

50-
- [Refactoring](../refactoring-in-visual-studio.md)
60+
- [Refactoring](../refactoring-in-visual-studio.md)

docs/xaml-tools/xaml-overview.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Use the XAML code editor and XAML Designer tools
33
description: Get basic information about the Extensible Application Markup Language (XAML) and how to work with the XAML code editor and XAML Designer tools in Visual Studio.
4-
ms.date: 06/23/2020
4+
ms.date: 08/15/2025
55
ms.topic: overview
66
author: maddymontaquila
77
ms.author: maleger
@@ -13,9 +13,10 @@ ms.subservice: xaml-tools
1313
Extensible Application Markup Language (XAML) is a declarative language that's based on XML. XAML is used extensively in the following types of applications to build user interfaces:
1414

1515
- [Windows Presentation Foundation (WPF) apps](/dotnet/framework/wpf/advanced/xaml-in-wpf)
16-
- [Universal Windows Platform (UWP) apps](/windows/uwp/xaml-platform/xaml-overview)
17-
- [Xamarin.Forms apps](/xamarin/xamarin-forms/xaml/)
1816
- [.NET MAUI apps](/dotnet/maui/xaml)
17+
- [WinUI](/windows/apps/winui/winui3/)
18+
- [Universal Windows Platform (UWP) apps](/windows/uwp/xaml-platform/xaml-overview)
19+
- [Xamarin.Forms apps](/xamarin/xamarin-forms/xaml/) (unsupported)
1920

2021
The following XAML code defines a simple button control.
2122

0 commit comments

Comments
 (0)