Skip to content

Commit

Permalink
Merge pull request #38520 from dotnet/main
Browse files Browse the repository at this point in the history
  • Loading branch information
BillWagner committed Nov 30, 2023
2 parents d86f6ea + 2ae44d5 commit f9b47ba
Show file tree
Hide file tree
Showing 22 changed files with 269 additions and 28 deletions.
25 changes: 25 additions & 0 deletions .openpublishing.redirection.fundamentals.json
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,31 @@
"source_path_from_root": "/docs/fundamentals/networking/httpclient-guidelines.md",
"redirect_url": "/dotnet/fundamentals/networking/http/httpclient-guidelines"
},
{
"source_path_from_root": "/docs/fundamentals/package-validation/baseline-version-validator.md",
"redirect_url": "/dotnet/fundamentals/apicompat/package-validation/baseline-version-validator",
"redirect_document_id": true
},
{
"source_path_from_root": "/docs/fundamentals/package-validation/compatible-framework-in-package-validator.md",
"redirect_url": "/dotnet/fundamentals/apicompat/package-validation/compatible-framework-in-package-validator",
"redirect_document_id": true
},
{
"source_path_from_root": "/docs/fundamentals/package-validation/compatible-framework-validator.md",
"redirect_url": "/dotnet/fundamentals/apicompat/package-validation/compatible-framework-validator",
"redirect_document_id": true
},
{
"source_path_from_root": "/docs/fundamentals/package-validation/diagnostic-ids.md",
"redirect_url": "/dotnet/fundamentals/apicompat/package-validation/diagnostic-ids",
"redirect_document_id": true
},
{
"source_path_from_root": "/docs/fundamentals/package-validation/overview.md",
"redirect_url": "/dotnet/fundamentals/apicompat/package-validation/overview",
"redirect_document_id": true
},
{
"source_path_from_root": "/docs/fundamentals/productivity/code-analysis.md",
"redirect_url": "/dotnet/fundamentals/code-analysis/overview"
Expand Down
4 changes: 2 additions & 2 deletions docs/azure/includes/dotnet-all.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@
| Monitor Ingestion | NuGet [1.1.1](https://www.nuget.org/packages/Azure.Monitor.Ingestion/1.1.1) | [docs](/dotnet/api/overview/azure/Monitor.Ingestion-readme) | GitHub [1.1.1](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Monitor.Ingestion_1.1.1/sdk/monitor/Azure.Monitor.Ingestion/) |
| Monitor Query | NuGet [1.2.0](https://www.nuget.org/packages/Azure.Monitor.Query/1.2.0)<br>NuGet [1.3.0-beta.1](https://www.nuget.org/packages/Azure.Monitor.Query/1.3.0-beta.1) | [docs](/dotnet/api/overview/azure/Monitor.Query-readme) | GitHub [1.2.0](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Monitor.Query_1.2.0/sdk/monitor/Azure.Monitor.Query/)<br>GitHub [1.3.0-beta.1](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Monitor.Query_1.3.0-beta.1/sdk/monitor/Azure.Monitor.Query/) |
| OpenAI Inference | NuGet [1.0.0-beta.9](https://www.nuget.org/packages/Azure.AI.OpenAI/1.0.0-beta.9) | [docs](/dotnet/api/overview/azure/AI.OpenAI-readme?view=azure-dotnet-preview&amp;preserve-view=true) | GitHub [1.0.0-beta.9](https://github.com/Azure/azure-sdk-for-net/tree/Azure.AI.OpenAI_1.0.0-beta.9/sdk/openai/Azure.AI.OpenAI/) |
| OpenTelemetry AspNetCore | NuGet [1.0.0-beta.8](https://www.nuget.org/packages/Azure.Monitor.OpenTelemetry.AspNetCore/1.0.0-beta.8) | [docs](/dotnet/api/overview/azure/Monitor.OpenTelemetry.AspNetCore-readme?view=azure-dotnet-preview&amp;preserve-view=true) | GitHub [1.0.0-beta.8](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Monitor.OpenTelemetry.AspNetCore_1.0.0-beta.8/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/) |
| OpenTelemetry Exporter | NuGet [1.0.0](https://www.nuget.org/packages/Azure.Monitor.OpenTelemetry.Exporter/1.0.0) | [docs](/dotnet/api/overview/azure/Monitor.OpenTelemetry.Exporter-readme) | GitHub [1.0.0](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Monitor.OpenTelemetry.Exporter_1.0.0/sdk/monitor/Azure.Monitor.OpenTelemetry.Exporter/) |
| OpenTelemetry AspNetCore | NuGet [1.0.0](https://www.nuget.org/packages/Azure.Monitor.OpenTelemetry.AspNetCore/1.0.0) | [docs](/dotnet/api/overview/azure/Monitor.OpenTelemetry.AspNetCore-readme) | GitHub [1.0.0](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Monitor.OpenTelemetry.AspNetCore_1.0.0/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/) |
| OpenTelemetry Exporter | NuGet [1.1.0](https://www.nuget.org/packages/Azure.Monitor.OpenTelemetry.Exporter/1.1.0) | [docs](/dotnet/api/overview/azure/Monitor.OpenTelemetry.Exporter-readme) | GitHub [1.1.0](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Monitor.OpenTelemetry.Exporter_1.1.0/sdk/monitor/Azure.Monitor.OpenTelemetry.Exporter/) |
| Personalizer | NuGet [2.0.0-beta.2](https://www.nuget.org/packages/Azure.AI.Personalizer/2.0.0-beta.2) | [docs](/dotnet/api/overview/azure/AI.Personalizer-readme?view=azure-dotnet-preview&amp;preserve-view=true) | GitHub [2.0.0-beta.2](https://github.com/Azure/azure-sdk-for-net/tree/Azure.AI.Personalizer_2.0.0-beta.2/sdk/personalizer/Azure.AI.Personalizer/) |
| Purview Account | NuGet [1.0.0-beta.1](https://www.nuget.org/packages/Azure.Analytics.Purview.Account/1.0.0-beta.1) | [docs](/dotnet/api/overview/azure/Analytics.Purview.Account-readme?view=azure-dotnet-preview&amp;preserve-view=true) | GitHub [1.0.0-beta.1](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Analytics.Purview.Account_1.0.0-beta.1/sdk/purview/Azure.Analytics.Purview.Account/) |
| Purview Administration | NuGet [1.0.0-beta.1](https://www.nuget.org/packages/Azure.Analytics.Purview.Administration/1.0.0-beta.1) | [docs](/dotnet/api/overview/azure/Analytics.Purview.Administration-readme?view=azure-dotnet-preview&amp;preserve-view=true) | GitHub [1.0.0-beta.1](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Analytics.Purview.Administration_1.0.0-beta.1/sdk/purview/Azure.Analytics.Purview.Administration/) |
Expand Down
4 changes: 2 additions & 2 deletions docs/azure/includes/dotnet-new.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@
| Monitor Ingestion | NuGet [1.1.1](https://www.nuget.org/packages/Azure.Monitor.Ingestion/1.1.1) | [docs](/dotnet/api/overview/azure/Monitor.Ingestion-readme) | GitHub [1.1.1](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Monitor.Ingestion_1.1.1/sdk/monitor/Azure.Monitor.Ingestion/) |
| Monitor Query | NuGet [1.2.0](https://www.nuget.org/packages/Azure.Monitor.Query/1.2.0)<br>NuGet [1.3.0-beta.1](https://www.nuget.org/packages/Azure.Monitor.Query/1.3.0-beta.1) | [docs](/dotnet/api/overview/azure/Monitor.Query-readme) | GitHub [1.2.0](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Monitor.Query_1.2.0/sdk/monitor/Azure.Monitor.Query/)<br>GitHub [1.3.0-beta.1](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Monitor.Query_1.3.0-beta.1/sdk/monitor/Azure.Monitor.Query/) |
| OpenAI Inference | NuGet [1.0.0-beta.9](https://www.nuget.org/packages/Azure.AI.OpenAI/1.0.0-beta.9) | [docs](/dotnet/api/overview/azure/AI.OpenAI-readme?view=azure-dotnet-preview&amp;preserve-view=true) | GitHub [1.0.0-beta.9](https://github.com/Azure/azure-sdk-for-net/tree/Azure.AI.OpenAI_1.0.0-beta.9/sdk/openai/Azure.AI.OpenAI/) |
| OpenTelemetry AspNetCore | NuGet [1.0.0-beta.8](https://www.nuget.org/packages/Azure.Monitor.OpenTelemetry.AspNetCore/1.0.0-beta.8) | [docs](/dotnet/api/overview/azure/Monitor.OpenTelemetry.AspNetCore-readme?view=azure-dotnet-preview&amp;preserve-view=true) | GitHub [1.0.0-beta.8](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Monitor.OpenTelemetry.AspNetCore_1.0.0-beta.8/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/) |
| OpenTelemetry Exporter | NuGet [1.0.0](https://www.nuget.org/packages/Azure.Monitor.OpenTelemetry.Exporter/1.0.0) | [docs](/dotnet/api/overview/azure/Monitor.OpenTelemetry.Exporter-readme) | GitHub [1.0.0](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Monitor.OpenTelemetry.Exporter_1.0.0/sdk/monitor/Azure.Monitor.OpenTelemetry.Exporter/) |
| OpenTelemetry AspNetCore | NuGet [1.0.0](https://www.nuget.org/packages/Azure.Monitor.OpenTelemetry.AspNetCore/1.0.0) | [docs](/dotnet/api/overview/azure/Monitor.OpenTelemetry.AspNetCore-readme) | GitHub [1.0.0](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Monitor.OpenTelemetry.AspNetCore_1.0.0/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/) |
| OpenTelemetry Exporter | NuGet [1.1.0](https://www.nuget.org/packages/Azure.Monitor.OpenTelemetry.Exporter/1.1.0) | [docs](/dotnet/api/overview/azure/Monitor.OpenTelemetry.Exporter-readme) | GitHub [1.1.0](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Monitor.OpenTelemetry.Exporter_1.1.0/sdk/monitor/Azure.Monitor.OpenTelemetry.Exporter/) |
| Personalizer | NuGet [2.0.0-beta.2](https://www.nuget.org/packages/Azure.AI.Personalizer/2.0.0-beta.2) | [docs](/dotnet/api/overview/azure/AI.Personalizer-readme?view=azure-dotnet-preview&amp;preserve-view=true) | GitHub [2.0.0-beta.2](https://github.com/Azure/azure-sdk-for-net/tree/Azure.AI.Personalizer_2.0.0-beta.2/sdk/personalizer/Azure.AI.Personalizer/) |
| Purview Account | NuGet [1.0.0-beta.1](https://www.nuget.org/packages/Azure.Analytics.Purview.Account/1.0.0-beta.1) | [docs](/dotnet/api/overview/azure/Analytics.Purview.Account-readme?view=azure-dotnet-preview&amp;preserve-view=true) | GitHub [1.0.0-beta.1](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Analytics.Purview.Account_1.0.0-beta.1/sdk/purview/Azure.Analytics.Purview.Account/) |
| Purview Administration | NuGet [1.0.0-beta.1](https://www.nuget.org/packages/Azure.Analytics.Purview.Administration/1.0.0-beta.1) | [docs](/dotnet/api/overview/azure/Analytics.Purview.Administration-readme?view=azure-dotnet-preview&amp;preserve-view=true) | GitHub [1.0.0-beta.1](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Analytics.Purview.Administration_1.0.0-beta.1/sdk/purview/Azure.Analytics.Purview.Administration/) |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,9 @@ Due to CAS's deprecation, the [supporting infrastructure was not brought forward
```xml
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<!-- NoWarn below suppresses SYSLIB0003 project-wide -->
<NoWarn>$(NoWarn);SYSLIB0003</NoWarn>
<TargetFramework>net5.0</TargetFramework>
<!-- NoWarn below suppresses SYSLIB0003 project-wide -->
<NoWarn>$(NoWarn);SYSLIB0003</NoWarn>
</PropertyGroup>
</Project>
```
Expand Down
3 changes: 3 additions & 0 deletions docs/core/diagnostics/built-in-metrics-aspnetcore.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ This article describes the metrics built-in for ASP.NET Core produced using the
<xref:System.Diagnostics.Metrics?displayProperty=nameWithType> API. For a listing of metrics based on the older [EventCounters](event-counters.md) API,
see [here](available-counters.md).

> [!TIP]
> For more information about how to collect, report, enrich, and test ASP.NET Core metrics, see [Using ASP.NET Core metrics](/aspnet/core/log-mon/metrics/metrics).
- [Meter: `Microsoft.AspNetCore.Hosting`](#meter-microsoftaspnetcorehosting)
- [Instrument: `http.server.request.duration`](#instrument-httpserverrequestduration)
- [Instrument: `http.server.active_requests`](#instrument-httpserveractive_requests)
Expand Down
2 changes: 1 addition & 1 deletion docs/core/project-sdk/msbuild-props.md
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ This property was introduced in .NET 6.

### EnablePackageValidation

The `EnablePackageValidation` property enables a series of validations on the package after the `pack` task. For more information, see [package validation](../../fundamentals/package-validation/overview.md).
The `EnablePackageValidation` property enables a series of validations on the package after the `pack` task. For more information, see [package validation](../../fundamentals/apicompat/package-validation/overview.md).

```xml
<PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion docs/core/tutorials/publishing-with-visual-studio-code.md
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ In the following steps, you'll look at the files created by the publish process.

1. On Windows or Linux, run the app by using the executable.

1. On Windows, enter `.\HelloWorld.exe` and press <kbd>Enter</kbd>.
1. On Windows, enter `.\HelloWorld.exe` and press <kbd>Enter</kbd>. On Windows with the Bash terminal, enter `./HelloWorld.exe`.

1. On Linux, enter `./HelloWorld` and press <kbd>Enter</kbd>.

Expand Down
2 changes: 1 addition & 1 deletion docs/core/whats-new/dotnet-6.md
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ In *preview* is the ability to use operators on generic types in .NET 6. .NET 6

## NuGet package validation

If you're a NuGet library developer, new [package-validation tooling](../../fundamentals/package-validation/overview.md) enables you to validate that your packages are consistent and well-formed. You can determine if:
If you're a NuGet library developer, new [package-validation tooling](../../fundamentals/apicompat/package-validation/overview.md) enables you to validate that your packages are consistent and well-formed. You can determine if:

- There are any breaking changes across package versions.
- The package has the same set of public APIs for all runtime-specific implementations.
Expand Down
188 changes: 188 additions & 0 deletions docs/fundamentals/apicompat/global-tool.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,188 @@
---
title: Microsoft.DotNet.ApiCompat.Tool global tool
description: Learn about the Microsoft.DotNet.ApiCompat.Tool global tool, which performs API compatibility checks on assemblies and packages.
ms.date: 11/29/2023
---

# Microsoft.DotNet.ApiCompat.Tool global tool

The Microsoft.DotNet.ApiCompat.Tool tool performs API compatibility checks on assemblies and packages. The tool has two modes:

- Compare a package against a baseline package.
- Compare an assembly against a baseline assembly.

## Install

To install the tool, run the following command.

```dotnetcli
dotnet tool install --global Microsoft.DotNet.ApiCompat.Tool
```

For more information about installing global tools, see [Install a global tool](../../core/tools/global-tools.md#install-a-global-tool).

## Usage

```dotnetcli
Microsoft.DotNet.ApiCompat.Tool [command] [options]
```

-or-

```dotnetcli
apicompat [command] [options]
```

## Commands

- **`package | --package <PACKAGE_FILE>`**

Validates the compatibility of package assets. If unspecified, the tool compares assemblies. `<PACKAGE_FILE>` specifies the path to the package file.

## Options

Some options apply to both assembly and package validation. Others apply to [assemblies only](#assembly-specific-options) or [packages only](#package-specific-options).

### General options

- **`--version`**

Shows version information.

- **`--generate-suppression-file`**

Generates a compatibility suppression file.

- **`--preserve-unnecessary-suppressions`**

Preserves unnecessary suppressions when regenerating the suppression file.

- **`--permit-unnecessary-suppressions`**

Permits unnecessary suppressions in the suppression file.

- **`--suppression-file <FILE>`**

Specifies the path to one or more suppression files to read from.

- **`--suppression-output-file <FILE>`**

Specifies the path to a suppression file to write to when `--generate-suppression-file` is specified.

- **`--noWarn <NOWARN_STRING>`**

Specifies the specific diagnostic IDs to suppress. For example, `"$(NoWarn);PKV0001"`.

- **`--respect-internals`**

Checks both `internal` and `public` APIs.

- **`--roslyn-assemblies-path <FILE>`**

Specifies the path to the directory that contains the Microsoft.CodeAnalysis assemblies.

- **`-v, --verbosity [high|low|normal]`**

Controls the log level verbosity. Allowable values are `high`, `normal`, and `low`. The default is `normal`.

- **`--enable-rule-attributes-must-match`**

Enables the rule that checks if attributes match.

- **`--exclude-attributes-file <FILE>`**

Specifies the path to one or more attribute exclusion files. These files contains types in [DocId](../../csharp/language-reference/xmldoc/index.md#id-strings) format.

- **`--enable-rule-cannot-change-parameter-name`**

Enables the rule that checks whether parameter names have changed in public methods.

### Assembly-specific options

These options are only applicable when assemblies are compared.

- **`-l, --left, --left-assembly <PATH>`**

Specifies the path to one or more assemblies that serve as the *left side* to compare. This option is required when comparing assemblies.

- **`-r, --right, --right-assembly`**

Specifies the path to one or more assemblies that serve as the *right side* to compare. This option is required when comparing assemblies.

- **`--strict-mode`**

Performs API compatibility checks in strict mode.

- **`--left-assembly-references, --lref <FILE1,FILE2,...>`**

Specifies the paths to assembly references or the underlying directories for the *left side*. Separate multiple values with a comma.

- **`--right-assembly-references, --rref <FILE1,FILE2,...>`**

Specifies the paths to assembly references or the underlying directories for the *right side*. Separate multiple values with a comma.

- **`--create-work-item-per-assembly`**

Enqueues a work item for the specified *left* and *right* assemblies.

- **`--left-assemblies-transformation-pattern <PATTERN>`**

Specifies a transformation pattern for the *left side* assemblies.

- **`--right-assemblies-transformation-pattern <PATTERN>`**

Specifies a transformation pattern for the *right side* assemblies.

### Package-specific options

These options are only applicable when packages are compared.

- **`--baseline-package`**

Specifies the path to a baseline package to validate against the current package.

- **`--runtime-graph`**

Specifies the path to the runtime graph to read from.

- **`--run-api-compat`**

Performs API compatibility checks on the package assets. The default is `true`.

- **`--enable-strict-mode-for-compatible-tfms`**

Validates API compatibility in strict mode for contract and implementation assemblies for all compatible target frameworks. The default is `true`.

- **`--enable-strict-mode-for-compatible-frameworks-in-package`**

Validates API compatibility in strict mode for assemblies that are compatible based on their target framework.

- **`--enable-strict-mode-for-baseline-validation`**

Validates API compatibility in strict mode for package baseline checks.

- **`--package-assembly-references`**

Specifies the paths to assembly references or their underlying directories for a specific target framework in the package. Separate multiple values with a comma.

- **`--baseline-package-assembly-references`**

Specifies the paths to assembly references or their underlying directories for a specific target framework in the *baseline* package. Separate multiple values with a comma.

- **`--baseline-package-frameworks-to-ignore`**

Specifies the set of target frameworks to ignore from the baseline package. The framework string must exactly match the folder name in the baseline package.

## Example

The following command compares the current and baseline versions of an assembly.

```dotnetcli
apicompat --left bin\Release\net8.0\LibApp5.dll --right bin\Release\net8.0\LibApp5-baseline.dll
```

The following command compares the current and baseline versions of a package.

```dotnetcli
apicompat package "bin\Release\LibApp5.1.0.0.nupkg" --baseline-package "bin\Release\LibApp5.2.0.0.nupkg"
```
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ C:\Program Files\dotnet\sdk\6.0.413\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET

![BaselineVersion](media/baseline-version.png)

You realize that while this is not a [source breaking change](../../standard/library-guidance/breaking-changes.md#source-breaking-change), it is a [binary breaking change](../../standard/library-guidance/breaking-changes.md#binary-breaking-change). You solve this problem by adding a new overload instead of adding a parameter to the existing method:
You realize that while this is not a [source breaking change](../../../standard/library-guidance/breaking-changes.md#source-breaking-change), it is a [binary breaking change](../../../standard/library-guidance/breaking-changes.md#binary-breaking-change). You solve this problem by adding a new overload instead of adding a parameter to the existing method:

```csharp
public static HttpClient Connect(string url)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ You've written the following code:

You then try to pack the project (using either `dotnet pack` or Visual Studio), and it fails with the following error:

```
```dotnetcli
D:\demo>dotnet pack
Microsoft (R) Build Engine version 17.0.0-preview-21460-01+8f208e609 for .NET
Copyright (C) Microsoft Corporation. All rights reserved.
Expand Down
Loading

0 comments on commit f9b47ba

Please sign in to comment.