Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minimum .NET version now 8.0 #6980

Closed
rjra100 opened this issue Mar 18, 2024 · 5 comments
Closed

Minimum .NET version now 8.0 #6980

rjra100 opened this issue Mar 18, 2024 · 5 comments

Comments

@rjra100
Copy link

rjra100 commented Mar 18, 2024

Type: Bug

The minimum .NET version for the C# extension now appears to be .NET 8.0 (as of C# extension v2.22.3)
Per https://dotnet.microsoft.com/en-us/platform/support/policy, .NET 7.0 is supported until May '24 and .NET 6.0 should be supported until November '24. Isn't dropping support for these in the extension a little premature?

Guess I'll go upgrade to .NET 8.0 (but some people are still stuck on RHEL (or CentOS) 7 and .NET 6.0)...

Output from C# pane:

Failed to find dotnet info from path, falling back to acquire runtime via ms-dotnettools.vscode-dotnet-runtime
No compatible .NET runtime found. Minimum required version is 8.0.
Dotnet path: /usr/bin/dotnet
Activating C# standalone...
waiting for named pipe information from server...
Language server process exited with 131
[Error - 5:40:05 PM] Microsoft.CodeAnalysis.LanguageServer client: couldn't create connection to server.
Error: Language server process exited with 131
	at ChildProcess.<anonymous> (/home/ralexander72/.vscode-server/extensions/ms-dotnettools.csharp-2.22.3-linux-x64/dist/extension.js:2:1291315)
	at ChildProcess.emit (node:events:514:28)
	at ChildProcess._handle.onexit (node:internal/child_process:291:12)
[stderr] You must install .NET to run this application.

App: /home/ralexander72/.vscode-server/extensions/ms-dotnettools.csharp-2.22.3-linux-x64/.roslyn/Microsoft.CodeAnalysis.LanguageServer
Architecture: x64
App host version: 8.0.1
.NET location: Not found

Learn more:
https://aka.ms/dotnet/app-launch-failed

Download the .NET runtime:
https://aka.ms/dotnet-core-applaunch?missing_runtime=true&arch=x64&rid=linux-x64&os=rhel.8&apphost_version=8.0.1

Extension version: 2.22.3
VS Code version: Code 1.87.2 (863d2581ecda6849923a2118d93a088b0745d9d6, 2024-03-08T15:20:17.278Z)
OS version: Windows_NT x64 10.0.19045

@dibarbet
Copy link
Member

Isn't dropping support for these in the extension a little premature?

To clarify here, we only upgraded the runtime that the language server uses to .net8. We can still load projects targeting .net6, .net7, .net8, etc. regardless of what runtime we use to run the language server. Additionally, the runtime used by the language server should be relatively transparent to you - if .net8 is not found on the path we acquire it via the runtime installer extension.

@rjra100 I notice from your logs that we determined .net8 was not installed - but it looks like it isn't being acquired by the runtime extension properly. Do you have any custom configurations setting the dotnetPath? If not would you mind posting the '.NET Runtime' output window logs?

@v-Judy
Copy link

v-Judy commented Mar 19, 2024

This issue also reproduces on the .NET9.0 SDK with VSCode v 1.87.2, C# Dev Kit v 1.4.29, C# v 2.22.5.
The 'Razor Logs' output window logs show as below:
image
image (1)

Using dotnet configured on PATH
[Client - 3:15:55 PM] Razor language server path: /Users/vs/.vscode/extensions/ms-dotnettools.csharp-2.22.5-darwin-x64/.razor/rzls
[Client - 3:15:55 PM] Server arguments --logLevel 2 --projectConfigurationFileName project.razor.vscode.bin --DelegateToCSharpOnDiagnosticPublish true --UpdateBuffersForClosedDocuments true --telemetryLevel all --sessionId 3cf33dfc-3ae6-4b08-a51f-a57b103873fb1710832553170 --telemetryExtensionPath /Users/vs/.vscode/extensions/ms-dotnettools.csharp-2.22.5-darwin-x64/.razortelemetry/Microsoft.VisualStudio.DevKit.Razor.dll
[Client - 3:15:55 PM] Starting Razor Language Server...
You must install or update .NET to run this application.
 
App: /Users/vs/.vscode/extensions/ms-dotnettools.csharp-2.22.5-darwin-x64/.razor/rzls
Architecture: x64
Framework: 'Microsoft.NETCore.App', version '8.0.1' (x64)
.NET location: /usr/local/share/dotnet
 
The following frameworks were found:
  9.0.0-preview.3.24162.31 at [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
 
Learn more:
https://aka.ms/dotnet/app-launch-failed
 
To install missing framework, download:
https://aka.ms/dotnet-core-applaunch?framework=Microsoft.NETCore.App&framework_version=8.0.1&arch=x64&rid=osx-x64&os=osx.12
[Error - 3:15:55 PM] Server initialization failed.
  Message: Pending response rejected since connection got disposed
  Code: -32097
[Info  - 3:15:55 PM] Connection to server got closed. Server will restart.
true
[Error - 3:15:55 PM] Razor Language Server client: couldn't create connection to server.
  Message: Pending response rejected since connection got disposed
  Code: -32097
You must install or update .NET to run this application.
 
App: /Users/vs/.vscode/extensions/ms-dotnettools.csharp-2.22.5-darwin-x64/.razor/rzls
Architecture: x64
Framework: 'Microsoft.NETCore.App', version '8.0.1' (x64)
.NET location: /usr/local/share/dotnet
 
The following frameworks were found:
  9.0.0-preview.3.24162.31 at [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
 
Learn more:
https://aka.ms/dotnet/app-launch-failed
 
To install missing framework, download:
https://aka.ms/dotnet-core-applaunch?framework=Microsoft.NETCore.App&framework_version=8.0.1&arch=x64&rid=osx-x64&os=osx.12
[Error - 3:15:55 PM] Server initialization failed.
  Message: Pending response rejected since connection got disposed
  Code: -32097
[Info  - 3:15:55 PM] Connection to server got closed. Server will restart.
true
[Error - 3:15:55 PM] Razor Language Server client: couldn't create connection to server.
  Message: Pending response rejected since connection got disposed
  Code: -32097
[Client - 3:15:55 PM] (Error) Failed when activating Razor VSCode.
Pending response rejected since connection got disposed
Stack Trace:
Error: Pending response rejected since connection got disposed
  at Object.dispose (/Users/vs/.vscode/extensions/ms-dotnettools.csharp-2.22.5-darwin-x64/dist/extension.js:2:2098108)
  at Object.dispose (/Users/vs/.vscode/extensions/ms-dotnettools.csharp-2.22.5-darwin-x64/dist/extension.js:2:2152884)
  at S.handleConnectionClosed (/Users/vs/.vscode/extensions/ms-dotnettools.csharp-2.22.5-darwin-x64/dist/extension.js:2:2153290)
  at S.handleConnectionClosed (/Users/vs/.vscode/extensions/ms-dotnettools.csharp-2.22.5-darwin-x64/dist/extension.js:2:2311358)
  at /Users/vs/.vscode/extensions/ms-dotnettools.csharp-2.22.5-darwin-x64/dist/extension.js:2:2153033
  at i.invoke (/Users/vs/.vscode/extensions/ms-dotnettools.csharp-2.22.5-darwin-x64/dist/extension.js:2:2099821)
  at o.fire (/Users/vs/.vscode/extensions/ms-dotnettools.csharp-2.22.5-darwin-x64/dist/extension.js:2:2100586)
  at te (/Users/vs/.vscode/extensions/ms-dotnettools.csharp-2.22.5-darwin-x64/dist/extension.js:2:2086231)
  at i.invoke (/Users/vs/.vscode/extensions/ms-dotnettools.csharp-2.22.5-darwin-x64/dist/extension.js:2:2099821)
  at o.fire (/Users/vs/.vscode/extensions/ms-dotnettools.csharp-2.22.5-darwin-x64/dist/extension.js:2:2100586)
  at v.fireClose (/Users/vs/.vscode/extensions/ms-dotnettools.csharp-2.22.5-darwin-x64/dist/extension.js:2:2108439)
  at Socket.<anonymous> (/Users/vs/.vscode/extensions/ms-dotnettools.csharp-2.22.5-darwin-x64/dist/extension.js:2:2110033)
  at Socket.emit (node:events:526:35)
  at Pipe.<anonymous> (node:net:323:12)
You must install or update .NET to run this application.
 
App: /Users/vs/.vscode/extensions/ms-dotnettools.csharp-2.22.5-darwin-x64/.razor/rzls
Architecture: x64
Framework: 'Microsoft.NETCore.App', version '8.0.1' (x64)
.NET location: /usr/local/share/dotnet
 
The following frameworks were found:
  9.0.0-preview.3.24162.31 at [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
 
Learn more:
https://aka.ms/dotnet/app-launch-failed
 
To install missing framework, download:
https://aka.ms/dotnet-core-applaunch?framework=Microsoft.NETCore.App&framework_version=8.0.1&arch=x64&rid=osx-x64&os=osx.12
[Error - 3:15:55 PM] Server initialization failed.
  Message: Cannot call write after a stream was destroyed
  Code: -32099
[Error - 3:15:55 PM] Razor Language Server client: couldn't create connection to server.
  Message: Cannot call write after a stream was destroyed
  Code: -32099
[Error - 3:15:55 PM] Restarting server failed
  Message: Cannot call write after a stream was destroyed
  Code: -32099
[Error - 3:15:55 PM] Restarting server failed
  Message: Cannot call write after a stream was destroyed
  Code: -32099
[Info  - 3:15:55 PM] Connection to server got closed. Server will restart.
true
You must install or update .NET to run this application.
 
App: /Users/vs/.vscode/extensions/ms-dotnettools.csharp-2.22.5-darwin-x64/.razor/rzls
Architecture: x64
Framework: 'Microsoft.NETCore.App', version '8.0.1' (x64)
.NET location: /usr/local/share/dotnet
 
The following frameworks were found:
  9.0.0-preview.3.24162.31 at [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
 
Learn more:
https://aka.ms/dotnet/app-launch-failed
 
To install missing framework, download:
https://aka.ms/dotnet-core-applaunch?framework=Microsoft.NETCore.App&framework_version=8.0.1&arch=x64&rid=osx-x64&os=osx.12
[Error - 3:15:55 PM] Server initialization failed.
  Message: Pending response rejected since connection got disposed
  Code: -32097
[Info  - 3:15:55 PM] Connection to server got closed. Server will restart.
true
[Error - 3:15:55 PM] Razor Language Server client: couldn't create connection to server.
  Message: Pending response rejected since connection got disposed
  Code: -32097
You must install or update .NET to run this application.
 
App: /Users/vs/.vscode/extensions/ms-dotnettools.csharp-2.22.5-darwin-x64/.razor/rzls
Architecture: x64
Framework: 'Microsoft.NETCore.App', version '8.0.1' (x64)
.NET location: /usr/local/share/dotnet
 
The following frameworks were found:
  9.0.0-preview.3.24162.31 at [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
 
Learn more:
https://aka.ms/dotnet/app-launch-failed
 
To install missing framework, download:
https://aka.ms/dotnet-core-applaunch?framework=Microsoft.NETCore.App&framework_version=8.0.1&arch=x64&rid=osx-x64&os=osx.12
[Error - 3:15:55 PM] Server initialization failed.
  Message: Pending response rejected since connection got disposed
  Code: -32097
[Error - 3:15:55 PM] The Razor Language Server server crashed 5 times in the last 3 minutes. The server will not be restarted. See the output for more information.
[Error - 3:15:55 PM] Razor Language Server client: couldn't create connection to server.
  Message: Pending response rejected since connection got disposed
  Code: -32097
[Error - 3:15:55 PM] Restarting server failed
  Message: Pending response rejected since connection got disposed
  Code: -32097
[Client - 3:16:04 PM] File '/Users/vs/RazorNoAuth/Pages/Privacy.cshtml' didn't exist in the Razor document list. This is likely because it's from outside the workspace.
[Client - 3:16:04 PM] (Warning) razor.provideDynamicFileInfo failed with CodeExpectedError: cannot open virtualCSharp-razor:/Users/vs/RazorNoAuth/Pages/Privacy.cshtml__virtual.cs. Detail: Unable to resolve resource virtualCSharp-razor:/Users/vs/RazorNoAuth/Pages/Privacy.cshtml__virtual.cs
[Client - 3:16:04 PM] File '/Users/vs/RazorNoAuth/Pages/Error.cshtml' didn't exist in the Razor document list. This is likely because it's from outside the workspace.
[Client - 3:16:04 PM] (Warning) razor.provideDynamicFileInfo failed with CodeExpectedError: cannot open virtualCSharp-razor:/Users/vs/RazorNoAuth/Pages/Error.cshtml__virtual.cs. Detail: Unable to resolve resource virtualCSharp-razor:/Users/vs/RazorNoAuth/Pages/Error.cshtml__virtual.cs
[Client - 3:16:04 PM] File '/Users/vs/RazorNoAuth/Pages/Shared/_ValidationScriptsPartial.cshtml' didn't exist in the Razor document list. This is likely because it's from outside the workspace.
[Client - 3:16:04 PM] (Warning) razor.provideDynamicFileInfo failed with CodeExpectedError: cannot open virtualCSharp-razor:/Users/vs/RazorNoAuth/Pages/Shared/_ValidationScriptsPartial.cshtml__virtual.cs. Detail: Unable to resolve resource virtualCSharp-razor:/Users/vs/RazorNoAuth/Pages/Shared/_ValidationScriptsPartial.cshtml__virtual.cs
[Client - 3:16:04 PM] File '/Users/vs/RazorNoAuth/Pages/_ViewStart.cshtml' didn't exist in the Razor document list. This is likely because it's from outside the workspace.
[Client - 3:16:04 PM] (Warning) razor.provideDynamicFileInfo failed with CodeExpectedError: cannot open virtualCSharp-razor:/Users/vs/RazorNoAuth/Pages/_ViewStart.cshtml__virtual.cs. Detail: Unable to resolve resource virtualCSharp-razor:/Users/vs/RazorNoAuth/Pages/_ViewStart.cshtml__virtual.cs
[Client - 3:16:04 PM] File '/Users/vs/RazorNoAuth/Pages/_ViewImports.cshtml' didn't exist in the Razor document list. This is likely because it's from outside the workspace.
[Client - 3:16:04 PM] (Warning) razor.provideDynamicFileInfo failed with CodeExpectedError: cannot open virtualCSharp-razor:/Users/vs/RazorNoAuth/Pages/_ViewImports.cshtml__virtual.cs. Detail: Unable to resolve resource virtualCSharp-razor:/Users/vs/RazorNoAuth/Pages/_ViewImports.cshtml__virtual.cs
[Client - 3:16:04 PM] File '/Users/vs/RazorNoAuth/Pages/Index.cshtml' didn't exist in the Razor document list. This is likely because it's from outside the workspace.
[Client - 3:16:04 PM] (Warning) razor.provideDynamicFileInfo failed with CodeExpectedError: cannot open virtualCSharp-razor:/Users/vs/RazorNoAuth/Pages/Index.cshtml__virtual.cs. Detail: Unable to resolve resource virtualCSharp-razor:/Users/vs/RazorNoAuth/Pages/Index.cshtml__virtual.cs
[Client - 3:16:04 PM] File '/Users/vs/RazorNoAuth/Pages/Shared/_Layout.cshtml' didn't exist in the Razor document list. This is likely because it's from outside the workspace.
[Client - 3:16:04 PM] (Warning) razor.provideDynamicFileInfo failed with CodeExpectedError: cannot open virtualCSharp-razor:/Users/vs/RazorNoAuth/Pages/Shared/_Layout.cshtml__virtual.cs. Detail: Unable to resolve resource virtualCSharp-razor:/Users/vs/RazorNoAuth/Pages/Shared/_Layout.cshtml__virtual.cs

@rjra100
Copy link
Author

rjra100 commented Mar 19, 2024

To clarify here, we only upgraded the runtime that the language server uses to .net8. We can still load projects targeting .net6, .net7, .net8, etc. regardless of what runtime we use to run the language server.

Fair - but at least one reason to be targetting .NET 6 or 7 is that that's the latest version that the OS in question supports. We've still got a lot of stuff on RHEL7 (don't ask), and I don't think .NETs more recent than 6 are supported on that. Fortunately we're almost in a position to switch our main development stream to RHEL8, so it's not as bad as it could be for us - but we're probably not the only ones.

I notice from your logs that we determined .net8 was not installed - but it looks like it isn't being acquired by the runtime extension properly. Do you have any custom configurations setting the dotnetPath?

No, though I do have a DOTNET_ROOT environment variable. However, I think the failure to download via the runtime extension is probably a local environment glitch - I have a local instance of NodeProxy which is supposed to direct things via the appropriate proxies for our excessively-complicated network setup, and it periodically dies. After I restarted that this morning, it does successfully download a runtime via the runtime extension (at least so long as I'm in the RHEL8 environment).

@dibarbet
Copy link
Member

@v-Judy looks like a slightly different issue on the Razor side - I filed dotnet/razor#10132 to track that on their side.

Fair - but at least one reason to be targetting .NET 6 or 7 is that that's the latest version that the OS in question supports. We've still got a lot of stuff on RHEL7 (don't ask), and I don't think .NETs more recent than 6 are supported on that.

I think it was .net8 that dropped rhel7 (ref).
It's a bit of a tradeoff here. We do want to make sure the extension works for a wide audience, but we also generally want to use the latest released versions of .net to take advantage of the new features and performance improvements in the runtime (even if the previous version isn't EoL yet).

In this case, since .net7 is EoL in 2 months anyway and rhel7 1 month later (plus .net8 is LTS), we feel its reasonable to take the upgrade. If rhel7 support is required, it's always possible to downgrade the extension version.

@dibarbet
Copy link
Member

Closing this as by design (Razor issue tracked separately).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants