Skip to content

Commit cadcdda

Browse files
Copilotkzu
andcommitted
Upgrade to .NET 9 for better SLNX support and test compatibility
Co-authored-by: kzu <[email protected]>
1 parent 89aaf0c commit cadcdda

File tree

3 files changed

+5
-24
lines changed

3 files changed

+5
-24
lines changed

global.json

Lines changed: 1 addition & 1 deletion
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
"allowPrerelease": false
66
}

src/NuGetizer.Tests/ModuleInitializer.cs

Lines changed: 3 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -72,29 +72,11 @@ static string GetDotNetSdkPath()
7272
var output = process.StandardOutput.ReadToEnd();
7373
process.WaitForExit();
7474

75-
// Parse the output to get SDK paths, prefer SDK 8.x for net8.0 compatibility
76-
// Output format: "8.0.100 [/usr/share/dotnet/sdk]"
75+
// Parse the output to get SDK paths, use the latest SDK
76+
// Output format: "9.0.100 [/usr/share/dotnet/sdk]"
7777
var lines = output.Split(new[] { '\r', '\n' }, StringSplitOptions.RemoveEmptyEntries);
7878

79-
// Look for an SDK version 8.x first (matches our target framework net8.0)
80-
foreach (var line in lines)
81-
{
82-
if (line.StartsWith("8."))
83-
{
84-
var startIndex = line.IndexOf('[');
85-
var endIndex = line.IndexOf(']');
86-
if (startIndex >= 0 && endIndex > startIndex)
87-
{
88-
var sdkBase = line.Substring(startIndex + 1, endIndex - startIndex - 1);
89-
var version = line.Substring(0, startIndex).Trim();
90-
var sdkPath = Path.Combine(sdkBase, version);
91-
File.AppendAllText(logFile, $"Found SDK 8.x at {sdkPath}\r\n");
92-
return sdkPath;
93-
}
94-
}
95-
}
96-
97-
// Fallback to latest SDK if no 8.x found
79+
// Use the latest SDK (last line)
9880
if (lines.Length > 0)
9981
{
10082
var lastLine = lines.Last();

src/NuGetizer.Tests/NuGetizer.Tests.csproj

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>net8.0</TargetFramework>
4+
<TargetFramework>net9.0</TargetFramework>
55
<DefaultItemExcludes>$(DefaultItemExcludes);Scenarios\**\*</DefaultItemExcludes>
66
<LangVersion>Preview</LangVersion>
7-
<RollForward>Major</RollForward>
87
</PropertyGroup>
98

109
<ItemGroup>

0 commit comments

Comments
 (0)