Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- name: Install Dotnet
uses: actions/setup-dotnet@607fce577a46308457984d59e4954e075820f10a
with:
dotnet-version: '9.0.x'
dotnet-version: '10.0.x'

- name: Dotnet Installation Info
run: dotnet --info
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- name: Install Dotnet
uses: actions/setup-dotnet@607fce577a46308457984d59e4954e075820f10a
with:
dotnet-version: '9.0.x'
dotnet-version: '10.0.x'

- name: Dotnet Installation Info
run: dotnet --info
Expand Down
46 changes: 23 additions & 23 deletions CSharpRepl.Services/CSharpRepl.Services.csproj
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Ben.Demystifier" Version="0.4.1" />
<PackageReference Include="ICSharpCode.Decompiler" Version="8.2.0.7535" />
<PackageReference Include="ICSharpCode.Decompiler" Version="9.1.0.7988" />
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="3.11.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Scripting" Version="4.11.0" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Features" Version="4.11.0" />
<PackageReference Include="Microsoft.CodeAnalysis.Workspaces.MSBuild" Version="4.11.0" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Scripting" Version="5.0.0" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Features" Version="5.0.0" />
<PackageReference Include="Microsoft.CodeAnalysis.Workspaces.MSBuild" Version="5.0.0" />
<PackageReference Include="Microsoft.Build.Locator" Version="1.7.8" />
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="9.0.0" />
<PackageReference Include="Microsoft.Extensions.DependencyModel" Version="9.0.0" />
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="10.0.0" />
<PackageReference Include="Microsoft.Extensions.DependencyModel" Version="10.0.0" />
<PackageReference Include="Microsoft.SymbolStore" Version="1.0.555801" />
<PackageReference Include="OpenAI" Version="2.1.0" />
<PackageReference Include="OpenAI" Version="2.7.0" />
<PackageReference Include="PrettyPrompt" Version="4.1.1" />
<PackageReference Include="Spectre.Console.Cli" Version="0.49.1" />
<PackageReference Include="System.IO.Abstractions" Version="21.1.3" />
<PackageReference Include="System.Configuration.ConfigurationManager" Version="9.0.0" />
<PackageReference Include="Spectre.Console.Cli" Version="0.53.0" />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a hotfix version later this version

Suggested change
<PackageReference Include="Spectre.Console.Cli" Version="0.53.0" />
<PackageReference Include="Spectre.Console.Cli" Version="0.53.1" />

<PackageReference Include="System.IO.Abstractions" Version="22.1.0" />
<PackageReference Include="System.Configuration.ConfigurationManager" Version="10.0.0" />
</ItemGroup>

<!--
Expand All @@ -33,19 +33,19 @@
https://github.com/OmniSharp/omnisharp-roslyn/commit/efeafeca33abe1d19659ed8c7ebab1d7c3481188
-->
<ItemGroup>
<PackageReference Include="NuGet.PackageManagement" Version="6.12.1" />
<PackageReference Include="NuGet.Common" Version="6.12.1" PrivateAssets="all" />
<PackageReference Include="NuGet.Commands" Version="6.12.1" PrivateAssets="all" />
<PackageReference Include="NuGet.Credentials" Version="6.12.1" PrivateAssets="all" />
<PackageReference Include="NuGet.Configuration" Version="6.12.1" PrivateAssets="all" />
<PackageReference Include="NuGet.DependencyResolver.Core" Version="6.12.1" PrivateAssets="all" />
<PackageReference Include="NuGet.Frameworks" Version="6.12.1" PrivateAssets="all" />
<PackageReference Include="NuGet.LibraryModel" Version="6.12.1" PrivateAssets="all" />
<PackageReference Include="NuGet.PackageManagement" Version="7.0.0" />
<PackageReference Include="NuGet.Common" Version="7.0.0" PrivateAssets="all" />
<PackageReference Include="NuGet.Commands" Version="7.0.0" PrivateAssets="all" />
<PackageReference Include="NuGet.Credentials" Version="7.0.0" PrivateAssets="all" />
<PackageReference Include="NuGet.Configuration" Version="7.0.0" PrivateAssets="all" />
<PackageReference Include="NuGet.DependencyResolver.Core" Version="7.0.0" PrivateAssets="all" />
<PackageReference Include="NuGet.Frameworks" Version="7.0.0" PrivateAssets="all" />
<PackageReference Include="NuGet.LibraryModel" Version="7.0.0" PrivateAssets="all" />
<PackageReference Include="NuGet.Packaging.Core" Version="6.9.1" PrivateAssets="all" />
<PackageReference Include="NuGet.Packaging" Version="6.12.1" PrivateAssets="all" />
<PackageReference Include="NuGet.ProjectModel" Version="6.12.1" PrivateAssets="all" />
<PackageReference Include="NuGet.Protocol" Version="6.12.1" PrivateAssets="all" />
<PackageReference Include="NuGet.Versioning" Version="6.12.1" PrivateAssets="all" />
<PackageReference Include="NuGet.Packaging" Version="7.0.0" PrivateAssets="all" />
<PackageReference Include="NuGet.ProjectModel" Version="7.0.0" PrivateAssets="all" />
<PackageReference Include="NuGet.Protocol" Version="7.0.0" PrivateAssets="all" />
<PackageReference Include="NuGet.Versioning" Version="7.0.0" PrivateAssets="all" />
</ItemGroup>


Expand Down
16 changes: 8 additions & 8 deletions CSharpRepl.Tests/CSharpRepl.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<IsPackable>false</IsPackable>
</PropertyGroup>

Expand All @@ -14,21 +14,21 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.0.1" />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.0.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.0.1" />

<PackageReference Include="NSubstitute" Version="5.3.0" />
<PackageReference Include="PrettyPrompt" Version="4.1.1" />
<PackageReference Include="Spectre.Console.Testing" Version="0.49.1" />
<PackageReference Include="System.IO.Abstractions.TestingHelpers" Version="21.1.3" />
<PackageReference Include="xunit" Version="2.9.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.2">
<PackageReference Include="Spectre.Console.Testing" Version="0.54.0" />
<PackageReference Include="System.IO.Abstractions.TestingHelpers" Version="22.1.0" />
<PackageReference Include="xunit" Version="2.9.3" />
<PackageReference Include="xunit.runner.visualstudio" Version="3.1.5">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="coverlet.collector" Version="6.0.2">
<PackageReference Include="coverlet.collector" Version="6.0.4">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="coverlet.msbuild" Version="6.0.2">
<PackageReference Include="coverlet.msbuild" Version="6.0.4">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<OutputType>Exe</OutputType>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="System.Management" Version="6.0.0" />
<PackageReference Include="System.Management" Version="10.0.0" />
</ItemGroup>

</Project>
4 changes: 2 additions & 2 deletions CSharpRepl.Tests/Data/WebApplication1.runtimeconfig.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"runtimeOptions": {
"tfm": "net6.0",
"tfm": "net10.0",
"framework": {
"name": "Microsoft.AspNetCore.App",
"version": "6.0.0"
"version": "10.0.0"
},
"configProperties": {
"System.GC.Server": true,
Expand Down
81 changes: 79 additions & 2 deletions CSharpRepl.Tests/DotNetInstallationLocatorTest.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
using System;
using CSharpRepl.Services.Roslyn.References;
using System;
using System.Collections.Generic;
using System.IO;
using System.IO.Abstractions.TestingHelpers;
using CSharpRepl.Services.Roslyn.References;
using System.Runtime.InteropServices;
using Xunit;

namespace CSharpRepl.Tests;
Expand Down Expand Up @@ -41,6 +42,82 @@ public void GetSharedFrameworkConfiguration_Net5GlobalInstallation_IsLocated()
);
}

[Fact]
public void GetSharedFrameworkConfiguration_Net10Installation_IsLocated()
{
var fileSystem = new MockFileSystem(new Dictionary<string, MockFileData>
{
{ @"/Program Files/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.0/data/FrameworkList.xml", string.Empty },
{ @"/Program Files/dotnet/packs/Microsoft.NETCore.App.Ref/9.0.0/ref/net9.0/Microsoft.CSharp.dll", string.Empty },
{ @"/Program Files/dotnet/packs/Microsoft.NETCore.App.Ref/10.0.0/data/FrameworkList.xml", string.Empty },
{ @"/Program Files/dotnet/packs/Microsoft.NETCore.App.Ref/10.0.0/ref/net10.0/Microsoft.CSharp.dll", string.Empty },
{ @"/Program Files/dotnet/packs/Microsoft.NETCore.App.Ref/10.0.1/data/FrameworkList.xml", string.Empty },
{ @"/Program Files/dotnet/packs/Microsoft.NETCore.App.Ref/10.0.1/ref/net10.0/Microsoft.CSharp.dll", string.Empty },

{ @"/Program Files/dotnet/shared/Microsoft.NETCore.App/9.0.2/Microsoft.CSharp.dll", string.Empty },
{ @"/Program Files/dotnet/shared/Microsoft.NETCore.App/10.0.0/Microsoft.CSharp.dll", string.Empty },
{ @"/Program Files/dotnet/shared/Microsoft.NETCore.App/10.0.1/Microsoft.CSharp.dll", string.Empty }
});

var locator = new DotNetInstallationLocator(
logger: new TestTraceLogger(), io: fileSystem,
dotnetRuntimePath: @"/Program Files/dotnet/",
userProfilePath: @"/Users/bob/"
);

var (refPath, implPath) = locator.FindInstallation("Microsoft.NETCore.App", new Version(10, 0, 1));

Assert.Equal(
CrossPlatform(@"/Program Files/dotnet/packs/Microsoft.NETCore.App.Ref/10.0.1/ref/net10.0"),
CrossPlatform(refPath)
);
Assert.Equal(
CrossPlatform(@"/Program Files/dotnet/shared/Microsoft.NETCore.App/10.0.1"),
CrossPlatform(implPath)
);
}

[Fact]
public void GetSharedFrameworkConfiguration_Net10UsesNuGetWhenNotInstalledGlobally()
{
string platform = OperatingSystem.IsWindows() ? "win"
: OperatingSystem.IsLinux() ? "linux"
: OperatingSystem.IsMacOS() ? "osx"
: null;

var architecture = RuntimeInformation.ProcessArchitecture.ToString().ToLowerInvariant();

var fileSystem = new MockFileSystem(new Dictionary<string, MockFileData>
{
// existing global runtimes but none for net10
{ @"/Program Files/dotnet/shared/Microsoft.NETCore.App/9.0.0/Microsoft.CSharp.dll", string.Empty },

// reference assemblies in .nuget installation
{ @"/Users/bob/.nuget/packages/microsoft.netcore.app.ref/10.0.0/data/FrameworkList.xml", string.Empty },
{ @"/Users/bob/.nuget/packages/microsoft.netcore.app.ref/10.0.0/ref/net10.0/Microsoft.CSharp.dll", string.Empty },

// implementation assemblies in .nuget installation
{ @$"/Users/bob/.nuget/packages/microsoft.netcore.app.runtime.{platform}-{architecture}/10.0.0/runtimes/{platform}-{architecture}/lib/net10.0/Microsoft.CSharp.dll", string.Empty },
});

var locator = new DotNetInstallationLocator(
logger: new TestTraceLogger(), io: fileSystem,
dotnetRuntimePath: @"/Program Files/dotnet/",
userProfilePath: @"/Users/bob/"
);

var (refPath, implPath) = locator.FindInstallation("Microsoft.NETCore.App", new Version(10, 0, 0));

Assert.Equal(
CrossPlatform(@"/Users/bob/.nuget/packages/microsoft.netcore.app.ref/10.0.0/ref/net10.0"),
CrossPlatform(refPath)
);
Assert.Equal(
CrossPlatform(@$"/Users/bob/.nuget/packages/microsoft.netcore.app.runtime.{platform}-{architecture}/10.0.0/runtimes/{platform}-{architecture}/lib/net10.0"),
CrossPlatform(implPath)
);
}

[Fact]
public void GetSharedFrameworkConfiguration_NoGlobalNet5ReferenceAssemblies_UsesNuGetInstallation()
{
Expand Down
2 changes: 1 addition & 1 deletion CSharpRepl.Tests/EvaluationTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ public async Task Evaluate_ResolveCorrectRuntimeVersionOfReferencedAssembly()
var (buildExitCode, _) = builder.Build("./Data/DemoSolution/DemoSolution.DemoProject3");
Assert.Equal(0, buildExitCode);

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

Assert.IsType<EvaluationResult.Success>(referenceResult);
Expand Down
16 changes: 8 additions & 8 deletions CSharpRepl.Tests/SymbolExplorerTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,27 +34,27 @@ public async Task GetSymbolAtIndex_ReturnsFullyQualifiedName()
[Fact]
public async Task GetSymbolAtIndex_ClassInSourceLinkedAssembly_ReturnsSourceLinkUrl()
{
// should return a string like https://www.github.com/dotnet/runtime/blob/208e377a5329ad6eb1db5e5fb9d4590fa50beadd/src/libraries/System.Console/src/System/Console.cs
// should return a string like https://www.github.com/dotnet/dotnet/blob/b0f34d51fccc69fd334253924abd8d6853fad7aa/src/runtime/src/libraries/System.Console/src/System/Console.cs
var symbol = await services.GetSymbolAtIndexAsync(@"Console.WriteLine(""howdy"")", "Conso".Length);

Assert.StartsWith("https://www.github.com/dotnet/runtime/", symbol.Url);
Assert.StartsWith("https://www.github.com/dotnet/dotnet/", symbol.Url);
Assert.EndsWith("Console.cs", symbol.Url);
}

[Fact]
public async Task GetSymbolAtIndex_GenericTypeInSourceLinkedAssembly_ReturnsSourceLinkUrl()
{
// should return a string like https://www.github.com/dotnet/runtime/blob/1381d5ebd2ab1f292848d5b19b80cf71ac332508/src/libraries/System.Private.CoreLib/src/System/Collections/Generic/List.cs
// 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
var symbol = await services.GetSymbolAtIndexAsync(@"List<string>", "Li".Length);

Assert.StartsWith("https://www.github.com/dotnet/runtime/", symbol.Url);
Assert.StartsWith("https://www.github.com/dotnet/dotnet/", symbol.Url);
Assert.EndsWith("List.cs", symbol.Url);
}

[Fact]
public async Task GetSymbolAtIndex_MethodInSourceLinkedAssembly_ReturnsSourceLinkUrl()
{
// should return a string like https://www.github.com/dotnet/runtime/blob/208e377a5329ad6eb1db5e5fb9d4590fa50beadd/src/libraries/System.Console/src/System/Console.cs#L635-L636
// 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
var symbol = await services.GetSymbolAtIndexAsync(@"Console.WriteLine(""howdy"")", "Console.Wri".Length);

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

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

AssertLinkWithLineNumber(symbol);
Expand Down Expand Up @@ -103,7 +103,7 @@ private static void AssertLinkWithLineNumber(SymbolResult symbol)
Assert.Equal(2, urlParts.Length);

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

var lineHash = urlParts[1];
const string LinePattern = "L[0-9]+";
Expand Down
4 changes: 2 additions & 2 deletions CSharpRepl/CSharpRepl.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<Version>0.6.7</Version>
<OutputType>Exe</OutputType>
<TargetFramework>net9.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<RollForward>LatestMajor</RollForward>
<LangVersion>latest</LangVersion>
<Nullable>enable</Nullable>
Expand All @@ -27,7 +27,7 @@
<ItemGroup>
<PackageReference Include="PrettyPrompt" Version="4.1.1" />
<PackageReference Include="System.CommandLine" Version="2.0.0-beta4.22272.1" />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe could move to the stable version, but may need to handle some breaking changes

Suggested change
<PackageReference Include="System.CommandLine" Version="2.0.0-beta4.22272.1" />
<PackageReference Include="System.CommandLine" Version="2.0.0" />

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I was looking into that... Although I managed to run it, many tests broke and I started to look into them to see exactly what needed to be updated... Might take some time

<PackageReference Include="System.Reflection.MetadataLoadContext" Version="9.0.0" />
<PackageReference Include="System.Reflection.MetadataLoadContext" Version="10.0.0" />
</ItemGroup>

<ItemGroup>
Expand Down
7 changes: 7 additions & 0 deletions global.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"sdk": {
"version": "10.0.0",
"rollForward": "latestMajor",
"allowPrerelease": true
}
}
Loading