Skip to content

Commit fdd9ad6

Browse files
feat: update to dotnet 10, with unit test fixes and some packages updated
1 parent bd79130 commit fdd9ad6

File tree

12 files changed

+135
-51
lines changed

12 files changed

+135
-51
lines changed

.github/workflows/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
- name: Install Dotnet
2121
uses: actions/setup-dotnet@607fce577a46308457984d59e4954e075820f10a
2222
with:
23-
dotnet-version: '9.0.x'
23+
dotnet-version: '10.0.x'
2424

2525
- name: Dotnet Installation Info
2626
run: dotnet --info

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
- name: Install Dotnet
1919
uses: actions/setup-dotnet@607fce577a46308457984d59e4954e075820f10a
2020
with:
21-
dotnet-version: '9.0.x'
21+
dotnet-version: '10.0.x'
2222

2323
- name: Dotnet Installation Info
2424
run: dotnet --info

CSharpRepl.Services/CSharpRepl.Services.csproj

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,29 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>net9.0</TargetFramework>
4+
<TargetFramework>net10.0</TargetFramework>
55
<Nullable>enable</Nullable>
66
</PropertyGroup>
77

88
<ItemGroup>
99
<PackageReference Include="Ben.Demystifier" Version="0.4.1" />
10-
<PackageReference Include="ICSharpCode.Decompiler" Version="8.2.0.7535" />
10+
<PackageReference Include="ICSharpCode.Decompiler" Version="9.1.0.7988" />
1111
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="3.11.0">
1212
<PrivateAssets>all</PrivateAssets>
1313
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
1414
</PackageReference>
15-
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Scripting" Version="4.11.0" />
16-
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Features" Version="4.11.0" />
17-
<PackageReference Include="Microsoft.CodeAnalysis.Workspaces.MSBuild" Version="4.11.0" />
15+
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Scripting" Version="5.0.0" />
16+
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Features" Version="5.0.0" />
17+
<PackageReference Include="Microsoft.CodeAnalysis.Workspaces.MSBuild" Version="5.0.0" />
1818
<PackageReference Include="Microsoft.Build.Locator" Version="1.7.8" />
19-
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="9.0.0" />
20-
<PackageReference Include="Microsoft.Extensions.DependencyModel" Version="9.0.0" />
19+
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="10.0.0" />
20+
<PackageReference Include="Microsoft.Extensions.DependencyModel" Version="10.0.0" />
2121
<PackageReference Include="Microsoft.SymbolStore" Version="1.0.555801" />
22-
<PackageReference Include="OpenAI" Version="2.1.0" />
22+
<PackageReference Include="OpenAI" Version="2.7.0" />
2323
<PackageReference Include="PrettyPrompt" Version="4.1.1" />
24-
<PackageReference Include="Spectre.Console.Cli" Version="0.49.1" />
25-
<PackageReference Include="System.IO.Abstractions" Version="21.1.3" />
26-
<PackageReference Include="System.Configuration.ConfigurationManager" Version="9.0.0" />
24+
<PackageReference Include="Spectre.Console.Cli" Version="0.53.0" />
25+
<PackageReference Include="System.IO.Abstractions" Version="22.1.0" />
26+
<PackageReference Include="System.Configuration.ConfigurationManager" Version="10.0.0" />
2727
</ItemGroup>
2828

2929
<!--
@@ -33,19 +33,19 @@
3333
https://github.com/OmniSharp/omnisharp-roslyn/commit/efeafeca33abe1d19659ed8c7ebab1d7c3481188
3434
-->
3535
<ItemGroup>
36-
<PackageReference Include="NuGet.PackageManagement" Version="6.12.1" />
37-
<PackageReference Include="NuGet.Common" Version="6.12.1" PrivateAssets="all" />
38-
<PackageReference Include="NuGet.Commands" Version="6.12.1" PrivateAssets="all" />
39-
<PackageReference Include="NuGet.Credentials" Version="6.12.1" PrivateAssets="all" />
40-
<PackageReference Include="NuGet.Configuration" Version="6.12.1" PrivateAssets="all" />
41-
<PackageReference Include="NuGet.DependencyResolver.Core" Version="6.12.1" PrivateAssets="all" />
42-
<PackageReference Include="NuGet.Frameworks" Version="6.12.1" PrivateAssets="all" />
43-
<PackageReference Include="NuGet.LibraryModel" Version="6.12.1" PrivateAssets="all" />
36+
<PackageReference Include="NuGet.PackageManagement" Version="7.0.0" />
37+
<PackageReference Include="NuGet.Common" Version="7.0.0" PrivateAssets="all" />
38+
<PackageReference Include="NuGet.Commands" Version="7.0.0" PrivateAssets="all" />
39+
<PackageReference Include="NuGet.Credentials" Version="7.0.0" PrivateAssets="all" />
40+
<PackageReference Include="NuGet.Configuration" Version="7.0.0" PrivateAssets="all" />
41+
<PackageReference Include="NuGet.DependencyResolver.Core" Version="7.0.0" PrivateAssets="all" />
42+
<PackageReference Include="NuGet.Frameworks" Version="7.0.0" PrivateAssets="all" />
43+
<PackageReference Include="NuGet.LibraryModel" Version="7.0.0" PrivateAssets="all" />
4444
<PackageReference Include="NuGet.Packaging.Core" Version="6.9.1" PrivateAssets="all" />
45-
<PackageReference Include="NuGet.Packaging" Version="6.12.1" PrivateAssets="all" />
46-
<PackageReference Include="NuGet.ProjectModel" Version="6.12.1" PrivateAssets="all" />
47-
<PackageReference Include="NuGet.Protocol" Version="6.12.1" PrivateAssets="all" />
48-
<PackageReference Include="NuGet.Versioning" Version="6.12.1" PrivateAssets="all" />
45+
<PackageReference Include="NuGet.Packaging" Version="7.0.0" PrivateAssets="all" />
46+
<PackageReference Include="NuGet.ProjectModel" Version="7.0.0" PrivateAssets="all" />
47+
<PackageReference Include="NuGet.Protocol" Version="7.0.0" PrivateAssets="all" />
48+
<PackageReference Include="NuGet.Versioning" Version="7.0.0" PrivateAssets="all" />
4949
</ItemGroup>
5050

5151

CSharpRepl.Tests/CSharpRepl.Tests.csproj

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>net9.0</TargetFramework>
4+
<TargetFramework>net10.0</TargetFramework>
55
<IsPackable>false</IsPackable>
66
</PropertyGroup>
77

@@ -14,21 +14,21 @@
1414
</ItemGroup>
1515

1616
<ItemGroup>
17-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
17+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.0.1" />
1818
<PackageReference Include="NSubstitute" Version="5.3.0" />
1919
<PackageReference Include="PrettyPrompt" Version="4.1.1" />
20-
<PackageReference Include="Spectre.Console.Testing" Version="0.49.1" />
21-
<PackageReference Include="System.IO.Abstractions.TestingHelpers" Version="21.1.3" />
22-
<PackageReference Include="xunit" Version="2.9.2" />
23-
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.2">
20+
<PackageReference Include="Spectre.Console.Testing" Version="0.54.0" />
21+
<PackageReference Include="System.IO.Abstractions.TestingHelpers" Version="22.1.0" />
22+
<PackageReference Include="xunit" Version="2.9.3" />
23+
<PackageReference Include="xunit.runner.visualstudio" Version="3.1.5">
2424
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
2525
<PrivateAssets>all</PrivateAssets>
2626
</PackageReference>
27-
<PackageReference Include="coverlet.collector" Version="6.0.2">
27+
<PackageReference Include="coverlet.collector" Version="6.0.4">
2828
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
2929
<PrivateAssets>all</PrivateAssets>
3030
</PackageReference>
31-
<PackageReference Include="coverlet.msbuild" Version="6.0.2">
31+
<PackageReference Include="coverlet.msbuild" Version="6.0.4">
3232
<PrivateAssets>all</PrivateAssets>
3333
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
3434
</PackageReference>

CSharpRepl.Tests/Data/ComplexSolution/EntryPoint/EntryPoint.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFramework>net6.0</TargetFramework>
5+
<TargetFramework>net10.0</TargetFramework>
66
<ImplicitUsings>enable</ImplicitUsings>
77
<Nullable>enable</Nullable>
88
</PropertyGroup>
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>net6.0</TargetFramework>
4+
<TargetFramework>net10.0</TargetFramework>
55
<OutputType>Exe</OutputType>
66
</PropertyGroup>
77

88
<ItemGroup>
9-
<PackageReference Include="System.Management" Version="6.0.0" />
9+
<PackageReference Include="System.Management" Version="10.0.0" />
1010
</ItemGroup>
1111

1212
</Project>

CSharpRepl.Tests/Data/WebApplication1.runtimeconfig.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
22
"runtimeOptions": {
3-
"tfm": "net6.0",
3+
"tfm": "net10.0",
44
"framework": {
55
"name": "Microsoft.AspNetCore.App",
6-
"version": "6.0.0"
6+
"version": "10.0.0"
77
},
88
"configProperties": {
99
"System.GC.Server": true,

CSharpRepl.Tests/DotNetInstallationLocatorTest.cs

Lines changed: 79 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
using System;
1+
using CSharpRepl.Services.Roslyn.References;
2+
using System;
23
using System.Collections.Generic;
34
using System.IO;
45
using System.IO.Abstractions.TestingHelpers;
5-
using CSharpRepl.Services.Roslyn.References;
6+
using System.Runtime.InteropServices;
67
using Xunit;
78

89
namespace CSharpRepl.Tests;
@@ -41,6 +42,82 @@ public void GetSharedFrameworkConfiguration_Net5GlobalInstallation_IsLocated()
4142
);
4243
}
4344

45+
[Fact]
46+
public void GetSharedFrameworkConfiguration_Net10Installation_IsLocated()
47+
{
48+
var fileSystem = new MockFileSystem(new Dictionary<string, MockFileData>
49+
{
50+
{ @"/Program Files/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.0/data/FrameworkList.xml", string.Empty },
51+
{ @"/Program Files/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.0/ref/net9.0/Microsoft.CSharp.dll", string.Empty },
52+
{ @"/Program Files/dotnet/packs/Microsoft.NETCore.App.Ref/10.0.0/data/FrameworkList.xml", string.Empty },
53+
{ @"/Program Files/dotnet/packs/Microsoft.NETCore.App.Ref/10.0.0/ref/net10.0/Microsoft.CSharp.dll", string.Empty },
54+
{ @"/Program Files/dotnet/packs/Microsoft.NETCore.App.Ref/10.0.1/data/FrameworkList.xml", string.Empty },
55+
{ @"/Program Files/dotnet/packs/Microsoft.NETCore.App.Ref/10.0.1/ref/net10.0/Microsoft.CSharp.dll", string.Empty },
56+
57+
{ @"/Program Files/dotnet/shared/Microsoft.NETCore.App/9.0.2/Microsoft.CSharp.dll", string.Empty },
58+
{ @"/Program Files/dotnet/shared/Microsoft.NETCore.App/10.0.0/Microsoft.CSharp.dll", string.Empty },
59+
{ @"/Program Files/dotnet/shared/Microsoft.NETCore.App/10.0.1/Microsoft.CSharp.dll", string.Empty }
60+
});
61+
62+
var locator = new DotNetInstallationLocator(
63+
logger: new TestTraceLogger(), io: fileSystem,
64+
dotnetRuntimePath: @"/Program Files/dotnet/",
65+
userProfilePath: @"/Users/bob/"
66+
);
67+
68+
var (refPath, implPath) = locator.FindInstallation("Microsoft.NETCore.App", new Version(10, 0, 1));
69+
70+
Assert.Equal(
71+
CrossPlatform(@"/Program Files/dotnet/packs/Microsoft.NETCore.App.Ref/10.0.1/ref/net10.0"),
72+
CrossPlatform(refPath)
73+
);
74+
Assert.Equal(
75+
CrossPlatform(@"/Program Files/dotnet/shared/Microsoft.NETCore.App/10.0.1"),
76+
CrossPlatform(implPath)
77+
);
78+
}
79+
80+
[Fact]
81+
public void GetSharedFrameworkConfiguration_Net10UsesNuGetWhenNotInstalledGlobally()
82+
{
83+
string platform = OperatingSystem.IsWindows() ? "win"
84+
: OperatingSystem.IsLinux() ? "linux"
85+
: OperatingSystem.IsMacOS() ? "osx"
86+
: null;
87+
88+
var architecture = RuntimeInformation.ProcessArchitecture.ToString().ToLowerInvariant();
89+
90+
var fileSystem = new MockFileSystem(new Dictionary<string, MockFileData>
91+
{
92+
// existing global runtimes but none for net10
93+
{ @"/Program Files/dotnet/shared/Microsoft.NETCore.App/9.0.0/Microsoft.CSharp.dll", string.Empty },
94+
95+
// reference assemblies in .nuget installation
96+
{ @"/Users/bob/.nuget/packages/microsoft.netcore.app.ref/10.0.0/data/FrameworkList.xml", string.Empty },
97+
{ @"/Users/bob/.nuget/packages/microsoft.netcore.app.ref/10.0.0/ref/net10.0/Microsoft.CSharp.dll", string.Empty },
98+
99+
// implementation assemblies in .nuget installation
100+
{ @$"/Users/bob/.nuget/packages/microsoft.netcore.app.runtime.{platform}-{architecture}/10.0.0/runtimes/{platform}-{architecture}/lib/net10.0/Microsoft.CSharp.dll", string.Empty },
101+
});
102+
103+
var locator = new DotNetInstallationLocator(
104+
logger: new TestTraceLogger(), io: fileSystem,
105+
dotnetRuntimePath: @"/Program Files/dotnet/",
106+
userProfilePath: @"/Users/bob/"
107+
);
108+
109+
var (refPath, implPath) = locator.FindInstallation("Microsoft.NETCore.App", new Version(10, 0, 0));
110+
111+
Assert.Equal(
112+
CrossPlatform(@"/Users/bob/.nuget/packages/microsoft.netcore.app.ref/10.0.0/ref/net10.0"),
113+
CrossPlatform(refPath)
114+
);
115+
Assert.Equal(
116+
CrossPlatform(@$"/Users/bob/.nuget/packages/microsoft.netcore.app.runtime.{platform}-{architecture}/10.0.0/runtimes/{platform}-{architecture}/lib/net10.0"),
117+
CrossPlatform(implPath)
118+
);
119+
}
120+
44121
[Fact]
45122
public void GetSharedFrameworkConfiguration_NoGlobalNet5ReferenceAssemblies_UsesNuGetInstallation()
46123
{

CSharpRepl.Tests/EvaluationTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ public async Task Evaluate_ResolveCorrectRuntimeVersionOfReferencedAssembly()
185185
var (buildExitCode, _) = builder.Build("./Data/DemoSolution/DemoSolution.DemoProject3");
186186
Assert.Equal(0, buildExitCode);
187187

188-
var referenceResult = await services.EvaluateAsync(@"#r ""./Data/DemoSolution/DemoSolution.DemoProject3/bin/Debug/net6.0/DemoSolution.DemoProject3.dll""");
188+
var referenceResult = await services.EvaluateAsync(@"#r ""./Data/DemoSolution/DemoSolution.DemoProject3/bin/Debug/net10.0/DemoSolution.DemoProject3.dll""");
189189
var importResult = await services.EvaluateAsync(@"DemoSolution.DemoProject3.DemoClass3.GetSystemManagementPath()");
190190

191191
Assert.IsType<EvaluationResult.Success>(referenceResult);

CSharpRepl.Tests/SymbolExplorerTests.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,27 +34,27 @@ public async Task GetSymbolAtIndex_ReturnsFullyQualifiedName()
3434
[Fact]
3535
public async Task GetSymbolAtIndex_ClassInSourceLinkedAssembly_ReturnsSourceLinkUrl()
3636
{
37-
// should return a string like https://www.github.com/dotnet/runtime/blob/208e377a5329ad6eb1db5e5fb9d4590fa50beadd/src/libraries/System.Console/src/System/Console.cs
37+
// should return a string like https://www.github.com/dotnet/dotnet/blob/b0f34d51fccc69fd334253924abd8d6853fad7aa/src/runtime/src/libraries/System.Console/src/System/Console.cs
3838
var symbol = await services.GetSymbolAtIndexAsync(@"Console.WriteLine(""howdy"")", "Conso".Length);
3939

40-
Assert.StartsWith("https://www.github.com/dotnet/runtime/", symbol.Url);
40+
Assert.StartsWith("https://www.github.com/dotnet/dotnet/", symbol.Url);
4141
Assert.EndsWith("Console.cs", symbol.Url);
4242
}
4343

4444
[Fact]
4545
public async Task GetSymbolAtIndex_GenericTypeInSourceLinkedAssembly_ReturnsSourceLinkUrl()
4646
{
47-
// should return a string like https://www.github.com/dotnet/runtime/blob/1381d5ebd2ab1f292848d5b19b80cf71ac332508/src/libraries/System.Private.CoreLib/src/System/Collections/Generic/List.cs
47+
// should return a string like https://www.github.com/dotnet/dotnet/blob/b0f34d51fccc69fd334253924abd8d6853fad7aa/src/runtime/src/libraries/System.Private.CoreLib/src/System/Collections/Generic/List.cs
4848
var symbol = await services.GetSymbolAtIndexAsync(@"List<string>", "Li".Length);
4949

50-
Assert.StartsWith("https://www.github.com/dotnet/runtime/", symbol.Url);
50+
Assert.StartsWith("https://www.github.com/dotnet/dotnet/", symbol.Url);
5151
Assert.EndsWith("List.cs", symbol.Url);
5252
}
5353

5454
[Fact]
5555
public async Task GetSymbolAtIndex_MethodInSourceLinkedAssembly_ReturnsSourceLinkUrl()
5656
{
57-
// should return a string like https://www.github.com/dotnet/runtime/blob/208e377a5329ad6eb1db5e5fb9d4590fa50beadd/src/libraries/System.Console/src/System/Console.cs#L635-L636
57+
// should return a string like https://www.github.com/dotnet/dotnet/blob/b0f34d51fccc69fd334253924abd8d6853fad7aa/src/runtime/src/libraries/System.Console/src/System/Console.cs#L733-L734
5858
var symbol = await services.GetSymbolAtIndexAsync(@"Console.WriteLine(""howdy"")", "Console.Wri".Length);
5959

6060
AssertLinkWithLineNumber(symbol);
@@ -63,7 +63,7 @@ public async Task GetSymbolAtIndex_MethodInSourceLinkedAssembly_ReturnsSourceLin
6363
[Fact]
6464
public async Task GetSymbolAtIndex_PropertyInSourceLinkedAssembly_ReturnsSourceLinkUrl()
6565
{
66-
// should return a string like https://www.github.com/dotnet/runtime/blob/208e377a5329ad6eb1db5e5fb9d4590fa50beadd/src/libraries/System.Console/src/System/Console.cs
66+
// should return a string like https://www.github.com/dotnet/dotnet/blob/b0f34d51fccc69fd334253924abd8d6853fad7aa/src/runtime/src/libraries/System.Console/src/System/Console.cs
6767
var symbol = await services.GetSymbolAtIndexAsync(@"Console.Out", "Console.Ou".Length);
6868

6969
AssertLinkWithLineNumber(symbol);
@@ -72,7 +72,7 @@ public async Task GetSymbolAtIndex_PropertyInSourceLinkedAssembly_ReturnsSourceL
7272
[Fact]
7373
public async Task GetSymbolAtIndex_EventInSourceLinkedAssembly_ReturnsSourceLinkUrl()
7474
{
75-
// should return a string like https://www.github.com/dotnet/runtime/blob/208e377a5329ad6eb1db5e5fb9d4590fa50beadd/src/libraries/System.Console/src/System/Console.cs
75+
// should return a string like https://www.github.com/dotnet/dotnet/blob/b0f34d51fccc69fd334253924abd8d6853fad7aa/src/runtime/src/libraries/System.Console/src/System/Console.cs
7676
var symbol = await services.GetSymbolAtIndexAsync(@"Console.CancelKeyPress", "Console.CancelKe".Length);
7777

7878
AssertLinkWithLineNumber(symbol);
@@ -103,7 +103,7 @@ private static void AssertLinkWithLineNumber(SymbolResult symbol)
103103
Assert.Equal(2, urlParts.Length);
104104

105105
var url = urlParts[0];
106-
Assert.StartsWith("https://www.github.com/dotnet/runtime/", url);
106+
Assert.StartsWith("https://www.github.com/dotnet/dotnet/", url);
107107

108108
var lineHash = urlParts[1];
109109
const string LinePattern = "L[0-9]+";

0 commit comments

Comments
 (0)