Skip to content

Commit 3bb3805

Browse files
Merge branch 'release/10.0.3xx' into bug/fix-dnx-with-private-feed
2 parents f3b9410 + f5a0378 commit 3bb3805

File tree

241 files changed

+11141
-9349
lines changed

Some content is hidden

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

241 files changed

+11141
-9349
lines changed

.github/copilot-instructions.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ Testing:
2121
- Examples:
2222
- `dotnet test test/dotnet.Tests/dotnet.Tests.csproj --filter "Name~ItShowsTheAppropriateMessageToTheUser"`
2323
- `dotnet exec artifacts/bin/redist/Debug/dotnet.Tests.dll -method "*ItShowsTheAppropriateMessageToTheUser*"`
24+
- For incremental test runs of `dotnet.Tests` (avoids slow full `build.cmd`), see the skill at `.github/copilot/skills/incremental-test.md`. In short: build only the modified projects, copy their output DLLs into the redist SDK layout, then run the tests.
2425
- To test CLI command changes:
2526
- Build the redist SDK: `./build.sh` from repo root
2627
- Create a dogfood environment: `source eng/dogfood.sh`
Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
# Incremental Test Runner for dotnet.Tests
2+
3+
This skill enables fast incremental test runs of `dotnet.Tests` without a full `build.cmd` rebuild.
4+
Use it after making source code changes to quickly build only the modified projects and deploy their outputs into the redist SDK layout so tests can run against them.
5+
6+
## Prerequisites
7+
8+
- A full build must have been completed at least once (via `build.cmd` or `build.sh`) so that the redist SDK layout exists at `artifacts\bin\redist\Debug\dotnet\sdk\<version>\`.
9+
- This workflow uses Windows/PowerShell commands and paths. On macOS/Linux, substitute forward slashes and use `cp` instead of `Copy-Item`.
10+
11+
## When to use
12+
13+
Use this skill when you need to run `dotnet.Tests` after modifying source code in one or more SDK projects. It avoids the slow full `build.cmd` by only rebuilding the changed projects and copying their output DLLs into the redist layout.
14+
15+
## Workflow
16+
17+
### Step 1: Identify modified projects
18+
19+
Determine which projects have been modified. Use context from:
20+
- The files you just edited in this session.
21+
- Or `git status`/`git diff` to find changed `.cs` files and map them to their `.csproj` projects.
22+
23+
### Step 2: Build modified projects
24+
25+
Build each modified project individually using the repo-local dotnet:
26+
27+
```
28+
.\.dotnet\dotnet build <path-to-project.csproj> -c Debug
29+
```
30+
31+
For example:
32+
```
33+
.\.dotnet\dotnet build src\Cli\Microsoft.DotNet.Cli.Utils\Microsoft.DotNet.Cli.Utils.csproj -c Debug
34+
```
35+
36+
If the `dotnet` CLI project itself was modified, build it:
37+
```
38+
.\.dotnet\dotnet build src\Cli\dotnet\dotnet.csproj -c Debug
39+
```
40+
41+
### Step 3: Copy output DLLs to the redist SDK layout
42+
43+
Discover the SDK version directory name:
44+
```powershell
45+
$sdkVersion = (Get-ChildItem artifacts\bin\redist\Debug\dotnet\sdk -Directory | Sort-Object LastWriteTime -Descending | Select-Object -First 1).Name
46+
```
47+
48+
For each modified project, copy its output DLL (and any satellite assemblies) from the project's build output to the redist SDK directory:
49+
50+
```
51+
Source: artifacts\bin\<ProjectName>\Debug\net10.0\<AssemblyName>.dll
52+
Target: artifacts\bin\redist\Debug\dotnet\sdk\<version>\
53+
```
54+
55+
For example:
56+
```powershell
57+
Copy-Item artifacts\bin\Microsoft.DotNet.ProjectTools\Debug\net10.0\Microsoft.DotNet.ProjectTools.dll artifacts\bin\redist\Debug\dotnet\sdk\$sdkVersion\
58+
Copy-Item artifacts\bin\Microsoft.DotNet.Cli.Utils\Debug\net10.0\Microsoft.DotNet.Cli.Utils.dll artifacts\bin\redist\Debug\dotnet\sdk\$sdkVersion\
59+
```
60+
61+
The `dotnet` project is special — it builds into `artifacts\bin\dotnet\Debug\net10.0\` and its `dotnet.dll` must be copied to the SDK directory:
62+
```powershell
63+
Copy-Item artifacts\bin\dotnet\Debug\net10.0\dotnet.dll artifacts\bin\redist\Debug\dotnet\sdk\$sdkVersion\
64+
```
65+
66+
**Important notes:**
67+
- For typical incremental edits, only copy DLLs that are **already present** in the target directory. If your change introduces a new shipped assembly or moves assemblies, you will need a full `build.cmd`/`build.sh` to update the layout correctly.
68+
- Some projects multi-target (e.g., `net10.0` and `net472`). Always use the `net10.0` output.
69+
- If localization resource DLLs were changed (in subdirectories like `cs\`, `de\`, etc.), copy those too.
70+
71+
### Step 4: Build the test project (if test code was modified)
72+
73+
The test project `test\dotnet.Tests\dotnet.Tests.csproj` outputs directly to `artifacts\bin\redist\Debug\` (via `TestHostFolder`), so just build it:
74+
75+
```
76+
.\.dotnet\dotnet build test\dotnet.Tests\dotnet.Tests.csproj
77+
```
78+
79+
### Step 5: Run the tests
80+
81+
Run specific tests:
82+
```
83+
.\.dotnet\dotnet exec artifacts\bin\redist\Debug\dotnet.Tests.dll -method "*TestMethodName*"
84+
```
85+
86+
Or run filtered tests via `dotnet test`:
87+
```
88+
.\.dotnet\dotnet test test\dotnet.Tests\dotnet.Tests.csproj --no-build --filter "Name~TestMethodName"
89+
```
90+
91+
## Common project paths
92+
93+
| Assembly | Project Path |
94+
|---|---|
95+
| `dotnet.dll` | `src\Cli\dotnet\dotnet.csproj` |
96+
| `Microsoft.DotNet.Cli.Utils.dll` | `src\Cli\Microsoft.DotNet.Cli.Utils\Microsoft.DotNet.Cli.Utils.csproj` |
97+
| `Microsoft.DotNet.Cli.Definitions.dll` | `src\Cli\Microsoft.DotNet.Cli.Definitions\Microsoft.DotNet.Cli.Definitions.csproj` |
98+
| `Microsoft.DotNet.Cli.CoreUtils.dll` | `src\Cli\Microsoft.DotNet.Cli.CoreUtils\Microsoft.DotNet.Cli.CoreUtils.csproj` |
99+
| `Microsoft.DotNet.Configurer.dll` | `src\Cli\Microsoft.DotNet.Configurer\Microsoft.DotNet.Configurer.csproj` |
100+
| `Microsoft.DotNet.ProjectTools.dll` | `src\Microsoft.DotNet.ProjectTools\Microsoft.DotNet.ProjectTools.csproj` |
101+
| `Microsoft.DotNet.NativeWrapper.dll` | `src\Resolvers\Microsoft.DotNet.NativeWrapper\Microsoft.DotNet.NativeWrapper.csproj` |
102+
| `Microsoft.DotNet.TemplateLocator.dll` | `src\Microsoft.DotNet.TemplateLocator\Microsoft.DotNet.TemplateLocator.csproj` |
103+
| `Microsoft.DotNet.InternalAbstractions.dll` | `src\Cli\Microsoft.DotNet.InternalAbstractions\Microsoft.DotNet.InternalAbstractions.csproj` |
104+
| `dotnet.Tests.dll` | `test\dotnet.Tests\dotnet.Tests.csproj` |

Directory.Build.props

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,9 @@
5050
<!-- TODO: Remove when Arcade updated NetCurrent to net10.0. -->
5151
<NetCurrent>net10.0</NetCurrent>
5252
<NetToolMinimum Condition="'$(DotNetBuildSourceOnly)' == 'true'">$(NetCurrent)</NetToolMinimum>
53-
<ToolsetTargetFramework>$(SdkTargetFramework)</ToolsetTargetFramework>
5453
<VisualStudioServiceTargetFramework>net9.0</VisualStudioServiceTargetFramework>
5554
<VisualStudioTargetFramework>net472</VisualStudioTargetFramework>
5655

57-
<!-- We used to have scenarios where the MSBuild host (VSMac) had an older .NET, but don't any more. -->
58-
<ResolverTargetFramework>$(SdkTargetFramework)</ResolverTargetFramework>
59-
6056
<!-- NU1701 Disable implicit package target fallback, and disable warning for when we explicitly add it (currently needed for
6157
Microsoft.ApplicationInsights) -->
6258
<!-- NU1507 Disable multi-feed check as .NET uses multiple internal feeds intentionally -->

Directory.Packages.props

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@
117117
<PackageVersion Include="runtime.linux-x64.Microsoft.NETCore.DotNetHostResolver" Version="$(MicrosoftNETCoreDotNetHostResolverPackageVersion)" />
118118
<PackageVersion Include="runtime.osx-x64.Microsoft.NETCore.DotNetHostResolver" Version="$(MicrosoftNETCoreDotNetHostResolverPackageVersion)" />
119119
<PackageVersion Include="Spectre.Console" Version="0.54.0" />
120+
<PackageVersion Include="Spectre.Console.Testing" Version="0.54.0" />
120121
<PackageVersion Include="StyleCop.Analyzers" Version="$(StyleCopAnalyzersPackageVersion)" />
121122
<PackageVersion Include="System.CodeDom" Version="$(SystemCodeDomPackageVersion)" />
122123
<PackageVersion Include="System.CommandLine" Version="$(SystemCommandLineVersion)" />

eng/Signing.props

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,8 @@
8686
<ItemGroup>
8787
<!-- Roslyn apphosts -->
8888
<FileSignInfo Condition="'$(TargetOS)' == 'osx'" Include="csc;vbc;VBCSCompiler" CertificateName="MacDeveloperHarden" />
89+
<!-- MSBuild apphost -->
90+
<FileSignInfo Condition="'$(TargetOS)' == 'osx'" Include="MSBuild" CertificateName="MacDeveloperHarden" />
8991
</ItemGroup>
9092

9193
<!-- Filter out any test packages from ItemsToSign -->

0 commit comments

Comments
 (0)