Skip to content

Commit 2009e51

Browse files
committed
Update to .NET SDK 9 for builds
1 parent c676360 commit 2009e51

File tree

6 files changed

+11
-51
lines changed

6 files changed

+11
-51
lines changed

.github/workflows/pull-request.yaml

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ jobs:
88
name: "Build"
99
runs-on: windows-2022
1010
env:
11+
DOTNET_CLI_WORKLOAD_UPDATE_NOTIFY_DISABLE: true
1112
DOTNET_NOLOGO: true
1213
steps:
1314
- name: Clone source
@@ -24,7 +25,7 @@ jobs:
2425
with:
2526
dotnet-version: |
2627
6.0.x
27-
8.0.x
28+
9.0.x
2829
2930
- name: Get .NET information
3031
run: dotnet --info

.github/workflows/push-main.yaml

+2-1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ jobs:
1010
name: "Build"
1111
runs-on: windows-2022
1212
env:
13+
DOTNET_CLI_WORKLOAD_UPDATE_NOTIFY_DISABLE: true
1314
DOTNET_NOLOGO: true
1415
steps:
1516
- name: Clone source
@@ -26,7 +27,7 @@ jobs:
2627
with:
2728
dotnet-version: |
2829
6.0.x
29-
8.0.x
30+
9.0.x
3031
3132
- name: Get .NET information
3233
run: dotnet --info

BUILDING.md

+1-37
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ as the only supported IDE environment (others like Resharper should work, though
88
You will need the following software installed:
99

1010
* .NET Framework 4.7.2 or later (part of the Windows OS)
11-
* [.NET SDK 8.0](https://dotnet.microsoft.com/download/dotnet/8.0)
11+
* [.NET SDK 9.0](https://dotnet.microsoft.com/download/dotnet/9.0)
1212
* [.NET 6.0 Runtime](https://dotnet.microsoft.com/download/dotnet/6.0)
1313
* [git](https://git-scm.com/downloads)
1414
* PowerShell (or [PowerShell Core](https://docs.microsoft.com/en-us/powershell/scripting/install/installing-powershell-core-on-windows?view=powershell-6))
@@ -40,39 +40,3 @@ Ensure that you have configured PowerShell to be able to run local unsigned scri
4040
You can get a list of options:
4141

4242
`./build --help`
43-
44-
## Debugging
45-
46-
Debugging the VS Adapter is tricky. There are two ways to do it depending on whether you want to do it under `net472` or `net6.0`. In all cases, you'll currently need to build your own test adapter NuGet package using `./build.ps1 Build` first to ensure you have local symbols. The symbols are not in the public package. It's helpful to add it to a local `\packages` directory and then use an entry like `<add key="Local Packages" value=".\packages" />` in your `NuGet.config` file to point to it. Don't forget to eventually delete it from your global profile `.nuget\packages\xunit...` when you're done.
47-
48-
### `net472`
49-
Easiest thing to do is add a `launchSettings.json` file that adds the `vstest.console.exe` as a startup project and point it to an xunit dll. Something like the following (use `/listtests` if you just want to debug the discovery portion):
50-
51-
```json
52-
{
53-
"profiles": {
54-
"vstest console": {
55-
"executablePath": "C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise\\Common7\\IDE\\CommonExtensions\\Microsoft\\TestWindow\\vstest.console.exe",
56-
"commandLineArgs": ".\\bin\\Debug\\net472\\Tests.System.Reactive.dll /TestAdapterPath:.\\bin\\Debug\\net472 /listtests",
57-
"workingDirectory": "C:\\dev\\RxNET\\Rx.NET\\Source\\Tests.System.Reactive\\"
58-
}
59-
}
60-
}
61-
```
62-
63-
With that as the startup project, you can set breakpoints and then hit them. You may need to manually load symbols the first time if it's not detected automatically.
64-
65-
### `net6.0`
66-
67-
Debugging the .NET Core version of the runner is currently much more difficult. You'll need [Process Explorer](https://technet.microsoft.com/en-us/sysinternals/processexplorer.aspx) to help locate the correct process to debug. This limitation should be improved in subsequent .NET Test Platform releases.
68-
69-
1. Start a PowerShell console and navigate to the directory with your test project
70-
2. Set an environment variable in that console session: `$env:VSTEST_HOST_DEBUG = 1`
71-
3. Build your test project: `dotnet build`
72-
4. Have VS open with the xUnit solution loaded
73-
5. Have Process Explorer open and in Tree View mode. You may want to update the "highlight delay" settings to 2-3 settings. Defaults to 1. Make the list scroll roughly to the "d's"
74-
6. Execute the test: `dotnet vstest .\bin\debug\net6.0\MyTest.dll` (you can use the `-lt` switch to do discovery only)
75-
7. The test adapter will wait for about 30 seconds for you to attach a debugger. You need to look for the "lowest" `dotnet.exe` process in the tree like this: ![img](https://cloud.githubusercontent.com/assets/1427284/21454655/2ca31676-c8e8-11e6-937b-06b16d8b9254.png). In this case, the PID you're looking for is `79404`.
76-
8. In VS, go to Debug -> Attach to Process and look for the PID (easiest to sort the column by PID). Ensure the debugger type is "Automatic" and it'll choose the CoreCLR debugger.
77-
9. Attach and then quickly hit Continue. It should load up the adapter and related code with symbols.
78-

global.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"sdk": {
3-
"version": "8.0.100",
3+
"version": "9.0.100",
44
"rollForward": "latestMinor"
55
}
66
}

tools/builder/build.csproj

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<NoWarn>$(NoWarn);CS8002</NoWarn>
4+
<!-- <NoWarn>$(NoWarn);CS8002</NoWarn> -->
55
<Nullable>enable</Nullable>
66
<OutputType>Exe</OutputType>
7-
<TargetFramework>net8.0</TargetFramework>
7+
<TargetFramework>net9.0</TargetFramework>
88
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
99
</PropertyGroup>
1010

1111
<ItemGroup>
1212
<!-- We may not be able to upgrade Bullseye easily because we are leveraging internal APIs -->
1313
<PackageReference Include="Bullseye" Version="3.3.0" />
14-
<PackageReference Include="McMaster.Extensions.CommandLineUtils" Version="4.0.2" />
14+
<PackageReference Include="McMaster.Extensions.CommandLineUtils" Version="4.1.1" />
1515
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
16-
<PackageReference Include="SimpleExec" Version="11.0.0" />
16+
<PackageReference Include="SimpleExec" Version="12.0.0" />
1717
</ItemGroup>
1818

1919
</Project>

tools/builder/targets/Packages.cs

+1-7
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,8 @@ public static async Task OnExecute(BuildContext context)
2323
.GetFiles(srcFolder, "*.nuspec", SearchOption.AllDirectories)
2424
.ToList();
2525

26-
// You can't see the created package name in .NET 9+ SDK without doing detailed verbosity
27-
var verbosity =
28-
context.DotNetSdkVersion.Major <= 8
29-
? context.Verbosity.ToString()
30-
: "detailed";
31-
3226
// Pack the .nuspec file(s)
3327
foreach (var nuspecFile in nuspecFiles.OrderBy(x => x))
34-
await context.Exec("dotnet", $"pack --nologo --no-build --configuration {context.ConfigurationText} --output {context.PackageOutputFolder} --verbosity {verbosity} \"{Path.GetDirectoryName(nuspecFile)}\" -p:NuspecFile={Path.GetFileName(nuspecFile)}");
28+
await context.Exec("dotnet", $"pack --nologo --no-build --configuration {context.ConfigurationText} --output {context.PackageOutputFolder} --verbosity {context.Verbosity} \"{Path.GetDirectoryName(nuspecFile)}\" -p:NuspecFile={Path.GetFileName(nuspecFile)} -tl:off");
3529
}
3630
}

0 commit comments

Comments
 (0)