C
C#6d ago
Kauan

C# Dev Kit Extension Syntax Highlighting and Autocomplete Not Working After Updating to .NET 9

Hi everyone, After updating to .NET 9, I noticed that the C# Dev Kit extension in VS Code is no longer providing syntax highlighting or autocomplete functionality. I tried configuring the dotnetAcquisitionExtension.existingDotnetPath in my settings like this:
"dotnetAcquisitionExtension.existingDotnetPath": [
{
"extensionId": "ms-dotnettools.csharp",
"path": "/home/kauan/.asdf/shims/dotnet"
},
{
"extensionId": "ms-dotnettools.csdevkit",
"path": "/home/kauan/.asdf/shims/dotnet"
}
]
"dotnetAcquisitionExtension.existingDotnetPath": [
{
"extensionId": "ms-dotnettools.csharp",
"path": "/home/kauan/.asdf/shims/dotnet"
},
{
"extensionId": "ms-dotnettools.csdevkit",
"path": "/home/kauan/.asdf/shims/dotnet"
}
]
Unfortunately, this didn’t solve the issue.
No description
No description
No description
No description
22 Replies
333fred
333fred6d ago
Not sure what asdf is or what that shim is, but it's probably not going to work DevKit needs the actual location of the SDK and supporting libraries, not some symlinked shim to dotnet
Kauan
KauanOP6d ago
asdf is a runtime configuration manager
asdf
Manage multiple runtime versions with a single CLI tool
Kauan
KauanOP6d ago
I'm not sure what the shims are either, but this is the path I get when I run the which dotnet command
No description
333fred
333fred6d ago
The location of the exe is only part of the equation You need the actual location of the SDK
Kauan
KauanOP6d ago
I tried this path from the command dotnet info, but it says that the value did not meet the requirements
No description
No description
333fred
333fred6d ago
I'm honestly not sure how asdf is setting up this installation You should be able to get more details from the output pane
Kauan
KauanOP6d ago
It looks like the c# dev kit is still looking for the dotnet 8
No description
333fred
333fred6d ago
To be clear, that's not devkit That's the base extension you're looking at But yes, it does look like it's still looking for 8 Try adding that and seeing if it works for you
Kauan
KauanOP6d ago
It didn't work but I think I found something here the environment variable was wrong, after running the command . ~/.asdf/plugins/dotnet-core/set-dotnet-home.zsh to update it and also changing the dotnetAcquisitionExtension.existingDotnetPath to the following:
"dotnetAcquisitionExtension.existingDotnetPath": [
{
"extensionId": "ms-dotnettools.csharp",
"path": "/home/kauan/.asdf/installs/dotnet-core/9.0.100/dotnet"
},
{
"extensionId": "ms-dotnettools.csdevkit",
"path": "/home/kauan/.asdf/installs/dotnet-core/9.0.100/dotnet"
}
]
"dotnetAcquisitionExtension.existingDotnetPath": [
{
"extensionId": "ms-dotnettools.csharp",
"path": "/home/kauan/.asdf/installs/dotnet-core/9.0.100/dotnet"
},
{
"extensionId": "ms-dotnettools.csdevkit",
"path": "/home/kauan/.asdf/installs/dotnet-core/9.0.100/dotnet"
}
]
Kauan
KauanOP6d ago
The error in the output dissapeared
No description
Kauan
KauanOP6d ago
but something is still missing because the autocomplete and syntax highlighting is not working
333fred
333fred6d ago
Do you have multiple solution files?
Kauan
KauanOP6d ago
just one
No description
333fred
333fred6d ago
Hmm. What happens if you run ".NET: Open Solution"?
Kauan
KauanOP6d ago
No description
Kauan
KauanOP6d ago
Failed to subscribe to active projects: Error: Activating the "Microsoft.VisualStudio.ProjectSystem.Query.Remoting.QueryExecutionService (0.3)" service failed.
Starting Query for all projects...
Failed at 'Query for all projects' (0ms) with error: Error: Activating the "Microsoft.VisualStudio.ProjectSystem.Query.Remoting.QueryExecutionService (0.3)" service failed.
Failed to subscribe to active projects: Error: Activating the "Microsoft.VisualStudio.ProjectSystem.Query.Remoting.QueryExecutionService (0.3)" service failed.
Starting Query for all projects...
Failed at 'Query for all projects' (0ms) with error: Error: Activating the "Microsoft.VisualStudio.ProjectSystem.Query.Remoting.QueryExecutionService (0.3)" service failed.
333fred
333fred6d ago
Hmm. @shep, any ideas?
shep
shep6d ago
I believe this issue is the same as https://github.com/dotnet/vscode-csharp/issues/7925 , where the existingdotnetpath option has problems with symlink paths. But it looks like you got past that one
GitHub
can not run csharp lsp if net 9 installed even i installed net8,Ple...
Environment data dotnet --info output: .NET SDK: Version: 9.0.100 Commit: a2bc464e40 Workload version: 9.0.100-manifests.6bf02610 MSBuild version: 17.12.7+a2bc464e4 Runtime Environment: OS Name: ub...
shep
shep6d ago
For this, I can't as easily say, I would file an issue at https://github.com/microsoft/vscode-dotnettools/issues since it looks like a devkit problem
GitHub
Issues · microsoft/vscode-dotnettools
This is a feedback repository to capture issues logged for the C# Dev Kit and related extensions from Visual Studio Code - Issues · microsoft/vscode-dotnettools
shep
shep6d ago
In general I would recommend avoiding setting the existingdotnetpath setting if you already have dotnet available on the path
Kauan
KauanOP6d ago
Thanks for the advice, I'll file the issue
Kauan
KauanOP5d ago
I found the problem, this option when enabled, was causing the problem
"dotnet.useLegacyDotnetResolution": false
"dotnet.useLegacyDotnetResolution": false
No description

Did you find this page helpful?