Skip to content

Commit 5a4fd2b

Browse files
Merge pull request #45543 from dotnet/main
Merge main into live
2 parents beb01c2 + 60a6164 commit 5a4fd2b

File tree

79 files changed

+1061
-947
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+1061
-947
lines changed

.openpublishing.redirection.core.json

+20
Original file line numberDiff line numberDiff line change
@@ -1358,6 +1358,10 @@
13581358
"source_path_from_root": "/docs/core/docker/publish-as-container.md",
13591359
"redirect_url": "/dotnet/core/containers/sdk-publish"
13601360
},
1361+
{
1362+
"source_path_from_root": "/docs/core/testing/unit-testing-fsharp-with-dotnet-test.md",
1363+
"redirect_url": "/dotnet/core/testing/unit-testing-fsharp-with-xunit"
1364+
},
13611365
{
13621366
"source_path_from_root": "/docs/core/testing/unit-testing-platform-architecture-capabilities.md",
13631367
"redirect_url": "/dotnet/core/testing/microsoft-testing-platform-architecture-capabilities"
@@ -1445,6 +1449,22 @@
14451449
{
14461450
"source_path_from_root": "/docs/core/testing/unit-testing-platform-vs-vstest.md",
14471451
"redirect_url": "/dotnet/core/testing/microsoft-testing-platform-vs-vstest"
1452+
},
1453+
{
1454+
"source_path_from_root": "/docs/core/testing/unit-testing-published-output.md",
1455+
"redirect_url": "/dotnet/core/tools/dotnet-vstest"
1456+
},
1457+
{
1458+
"source_path_from_root": "/docs/core/testing/unit-testing-visual-basic-with-dotnet-test.md",
1459+
"redirect_url": "/dotnet/core/testing/unit-testing-visual-basic-with-xunit"
1460+
},
1461+
{
1462+
"source_path_from_root": "/docs/core/testing/unit-testing-with-mstest.md",
1463+
"redirect_url": "/dotnet/core/testing/unit-testing-csharp-with-mstest"
1464+
},
1465+
{
1466+
"source_path_from_root": "/docs/core/testing/unit-testing-with-nunit.md",
1467+
"redirect_url": "/dotnet/core/testing/unit-testing-csharp-with-nunit"
14481468
}
14491469
]
14501470
}

docs/ai/tutorials/snippets/llm-eval/llm-eval.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<ItemGroup>
1313
<PackageReference Include="Microsoft.Extensions.Configuration" Version="9.0.3" />
1414
<PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" Version="9.0.3" />
15-
<PackageReference Include="Microsoft.SemanticKernel" Version="1.42.0" />
15+
<PackageReference Include="Microsoft.SemanticKernel" Version="1.43.0" />
1616
</ItemGroup>
1717

1818
</Project>

docs/architecture/maui/unit-testing.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -62,14 +62,14 @@ Testing models and view models from MVVM applications is identical to testing an
6262

6363
Don't be tempted to make a unit test exercise more than one aspect of the unit's behavior. Doing so leads to tests that are difficult to read and update. It can also lead to confusion when interpreting a failure.
6464

65-
The eShop multi-platform app uses [MSTest](../../core/testing/unit-testing-with-mstest.md) to perform unit testing, which supports two different types of unit tests:
65+
The eShop multi-platform app uses [MSTest](../../core/testing/unit-testing-csharp-with-mstest.md) to perform unit testing, which supports two different types of unit tests:
6666

6767
| Testing Type | Attribute | Description |
6868
|-----------------|--------------|--------------------------------------------------------------|
6969
| TestMethod | `TestMethod` | Defines the actual test method to run. |
7070
| DataSource | `DataSource` | Tests that are only true for a particular set of data. |
7171

72-
The unit tests included with the eShop multi-platform app are TestMethod, so each unit test method is decorated with the `TestMethod` attribute. In addition to MSTest there are several other testing frameworks available including [NUnit](../../core/testing/unit-testing-with-nunit.md) and [xUnit](../../core/testing/unit-testing-with-dotnet-test.md).
72+
The unit tests included with the eShop multi-platform app are TestMethod, so each unit test method is decorated with the `TestMethod` attribute. In addition to MSTest there are several other testing frameworks available including [NUnit](../../core/testing/unit-testing-csharp-with-nunit.md) and [xUnit](../../core/testing/unit-testing-csharp-with-xunit.md).
7373

7474
## Testing asynchronous functionality
7575

docs/azure/includes/dotnet-all.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -554,7 +554,7 @@
554554
| Microsoft.Azure.Functions.Worker.Grpc | NuGet [2.0.0](https://www.nuget.org/packages/Microsoft.Azure.Functions.Worker.Grpc/2.0.0) | | |
555555
| Microsoft.Azure.Functions.Worker.ItemTemplates | NuGet [4.0.5051](https://www.nuget.org/packages/Microsoft.Azure.Functions.Worker.ItemTemplates/4.0.5051) | | |
556556
| Microsoft.Azure.Functions.Worker.ProjectTemplates | NuGet [4.0.5051](https://www.nuget.org/packages/Microsoft.Azure.Functions.Worker.ProjectTemplates/4.0.5051) | | |
557-
| Microsoft.Azure.Functions.Worker.Sdk | NuGet [2.0.1](https://www.nuget.org/packages/Microsoft.Azure.Functions.Worker.Sdk/2.0.1) | | |
557+
| Microsoft.Azure.Functions.Worker.Sdk | NuGet [2.0.2](https://www.nuget.org/packages/Microsoft.Azure.Functions.Worker.Sdk/2.0.2) | | |
558558
| Microsoft.Azure.Functions.Worker.Sdk.Analyzers | NuGet [1.2.2](https://www.nuget.org/packages/Microsoft.Azure.Functions.Worker.Sdk.Analyzers/1.2.2) | | |
559559
| Microsoft.Azure.Functions.Worker.Sdk.Generators | NuGet [1.3.4](https://www.nuget.org/packages/Microsoft.Azure.Functions.Worker.Sdk.Generators/1.3.4) | | |
560560
| Microsoft.Azure.WebJobs.CosmosDb.ChangeProcessor | NuGet [1.0.4](https://www.nuget.org/packages/Microsoft.Azure.WebJobs.CosmosDb.ChangeProcessor/1.0.4) | | |

docs/azure/sdk/unit-testing-mocking.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -265,4 +265,4 @@ Here's how it works:
265265

266266
* [Dependency injection in .NET](../../core/extensions/dependency-injection.md)
267267
* [Unit testing best practices](../../core/testing/unit-testing-best-practices.md)
268-
* [Unit testing C# in .NET using dotnet test and xUnit](../../core/testing/unit-testing-with-dotnet-test.md)
268+
* [Unit testing C# in .NET using dotnet test and xUnit](../../core/testing/unit-testing-csharp-with-xunit.md)

docs/core/compatibility/10.0.md

+6-5
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: Breaking changes in .NET 10
33
titleSuffix: ""
44
description: Navigate to the breaking changes in .NET 10.
5-
ms.date: 01/30/2025
5+
ms.date: 03/25/2025
66
ai-usage: ai-assisted
77
no-loc: [Blazor, Razor, Kestrel]
88
---
@@ -49,10 +49,11 @@ If you're migrating an app to .NET 10, the breaking changes listed here might af
4949

5050
## SDK
5151

52-
| Title | Type of change | Introduced version |
53-
|----------------------------------------------------------------------------------------------------------------------|-------------------|--------------------|
54-
| [Default workload configuration from 'loose manifests' to 'workload sets' mode](sdk/10.0/default-workload-config.md) | Behavioral change | Preview 2 |
55-
| [MSBUILDCUSTOMBUILDEVENTWARNING escape hatch removed](sdk/10.0/custom-build-event-warning.md) | Behavioral change | Preview 1 |
52+
| Title | Type of change | Introduced version |
53+
|----------------------------------------------------------------------------------------------------------------------|---------------------|--------------------|
54+
| [Default workload configuration from 'loose manifests' to 'workload sets' mode](sdk/10.0/default-workload-config.md) | Behavioral change | Preview 2 |
55+
| [MSBUILDCUSTOMBUILDEVENTWARNING escape hatch removed](sdk/10.0/custom-build-event-warning.md) | Behavioral change | Preview 1 |
56+
| [NU1510 is raised for direct references pruned by NuGet](sdk/10.0/nu1510-pruned-references.md) | Source incompatible | Preview 1 |
5657

5758
## Windows Forms
5859

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
---
2+
title: "Breaking change - NU1510 is raised for direct references pruned by NuGet"
3+
description: "Learn about the breaking change in .NET 10 where NU1510 is raised for unnecessary direct package references."
4+
ms.date: 3/25/2025
5+
ai-usage: ai-assisted
6+
ms.custom: https://github.com/dotnet/docs/issues/45462
7+
---
8+
9+
# NU1510 is raised for direct references pruned by NuGet
10+
11+
Starting in .NET 10, NuGet raises a [`NU1510` warning](/nuget/reference/errors-and-warnings/nu1510) when a project includes a direct package reference that overlaps with a framework-provided library and is not required.
12+
13+
## Version introduced
14+
15+
.NET 10 Preview 1
16+
17+
## Previous behavior
18+
19+
Previously, the .NET SDK ignored the contents of a package if it overlapped with a framework-provided library. The package reference was allowed but had no effect on the build output.
20+
21+
## New behavior
22+
23+
NuGet now removes unnecessary package references entirely and raises a `NU1510` warning to notify you of the issue.
24+
25+
## Type of breaking change
26+
27+
This is a [source-incompatible change](../../categories.md#source-compatibility).
28+
29+
## Reason for change
30+
31+
This change reduces the maintenance burden on developers by eliminating unused package references. It prevents unnecessary updates, reduces download and restore times, and ensures cleaner build artifacts. The [`NU1510` warning](/nuget/reference/errors-and-warnings/nu1510) warning helps you identify and clean up these references proactively.
32+
33+
## Recommended action
34+
35+
If your project targets only frameworks where the package is pruned, remove the package reference entirely. For multi-targeting projects, conditionally include the package reference only for frameworks that require it. Use the following example as a guide:
36+
37+
```xml
38+
<ItemGroup>
39+
<!-- reference 8.0 System.Text.Json when targeting things older than .NET 8 -->
40+
<PackageReference Include="System.Text.Json" Version="8.0.5" Condition="!$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net8.0'))" />
41+
42+
<!-- reference 10.0 System.Linq.AsyncEnumerable when targeting things older than .NET 10 -->
43+
<PackageReference Include="System.Linq.AsyncEnumerable" Version="10.0.0-preview.2.25163.2" Condition="!$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net.10'))" />
44+
45+
<!-- Reference System.Memory on frameworks not compatible with .NET Core 2.1 nor .NETStandard 2.1 -->
46+
<PackageReference Include="System.Memory" Condition="!$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'netcoreapp2.1')) and !$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'netstandard2.1'))" />
47+
</ItemGroup>
48+
```
49+
50+
## Affected APIs
51+
52+
None.

docs/core/compatibility/toc.yml

+4
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ items:
4646
href: sdk/10.0/default-workload-config.md
4747
- name: MSBUILDCUSTOMBUILDEVENTWARNING escape hatch removed
4848
href: sdk/10.0/custom-build-event-warning.md
49+
- name: NU1510 is raised for direct references pruned by NuGet
50+
href: sdk/10.0/nu1510-pruned-references.md
4951
- name: Windows Forms
5052
items:
5153
- name: API obsoletions
@@ -1908,6 +1910,8 @@ items:
19081910
href: sdk/10.0/default-workload-config.md
19091911
- name: MSBUILDCUSTOMBUILDEVENTWARNING escape hatch removed
19101912
href: sdk/10.0/custom-build-event-warning.md
1913+
- name: NU1510 is raised for direct references pruned by NuGet
1914+
href: sdk/10.0/nu1510-pruned-references.md
19111915
- name: .NET 9
19121916
items:
19131917
- name: "`dotnet restore` audits transitive packages"

docs/core/testing/index.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ The test framework is built on top of the test platform. It defines the set of a
5454
For more information, see the following resources:
5555

5656
- [Microsoft.Testing.Platform support in MSTest (MSTest runner)](unit-testing-mstest-runner-intro.md)
57-
- [Unit testing with C#](unit-testing-with-mstest.md)
57+
- [Unit testing with C#](unit-testing-csharp-with-mstest.md)
5858
- [Unit testing with F#](unit-testing-fsharp-with-mstest.md)
5959
- [Unit testing with Visual Basic](unit-testing-visual-basic-with-mstest.md)
6060

@@ -65,7 +65,7 @@ For more information, see the following resources:
6565
For more information, see the following resources:
6666

6767
- [Microsoft.Testing.Platform support in NUnit (NUnit runner)](unit-testing-nunit-runner-intro.md)
68-
- [Unit testing with C#](unit-testing-with-nunit.md)
68+
- [Unit testing with C#](unit-testing-csharp-with-nunit.md)
6969
- [Unit testing with F#](unit-testing-fsharp-with-nunit.md)
7070
- [Unit testing with Visual Basic](unit-testing-visual-basic-with-nunit.md)
7171

@@ -80,9 +80,9 @@ For more information, see the following resources:
8080
For more information, see the following resources:
8181

8282
- [Microsoft.Testing.Platform support in xUnit.net v3](https://xunit.net/docs/getting-started/v3/microsoft-testing-platform)
83-
- [Unit testing with C#](unit-testing-with-dotnet-test.md)
84-
- [Unit testing with F#](unit-testing-fsharp-with-dotnet-test.md)
85-
- [Unit testing with Visual Basic](unit-testing-visual-basic-with-dotnet-test.md)
83+
- [Unit testing with C#](unit-testing-csharp-with-xunit.md)
84+
- [Unit testing with F#](unit-testing-fsharp-with-xunit.md)
85+
- [Unit testing with Visual Basic](unit-testing-visual-basic-with-xunit.md)
8686

8787
## Running tests
8888

docs/core/testing/snippets/unit-testing-using-mstest/csharp/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Unit testing using MSTest sample
22

3-
This sample is part of the [unit testing tutorial](https://learn.microsoft.com/dotnet/core/testing/unit-testing-with-mstest) for creating applications with unit tests included. See that topic for detailed steps on the code for this sample.
3+
This sample is part of the [unit testing tutorial](https://learn.microsoft.com/dotnet/core/testing/unit-testing-csharp-with-mstest) for creating applications with unit tests included. See that topic for detailed steps on the code for this sample.
44

55
## Key features
66

docs/core/testing/unit-testing-with-mstest.md docs/core/testing/unit-testing-csharp-with-mstest.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,8 @@ Make the *PrimeService.Tests* directory the current directory and create a new p
6565

6666
```xml
6767
<ItemGroup>
68-
<PackageReference Include="MSTest" Version="3.8.3" />
68+
<PackageReference Include="MSTest" Version="3.2.0" />
69+
<PackageReference Include="Microsoft.Testing.Extensions.CodeCoverage" Version="17.10.1" />
6970
</ItemGroup>
7071
```
7172

0 commit comments

Comments
 (0)