C
C#12mo ago
PK™

❔ C# Dev Kit can't start language server

I'm making a tML mod and it doesn't work with C# dev kit. Output as of yet is just:
Dotnet path: /home/redacted/.config/Code/User/globalStorage/ms-dotnettools.vscode-dotnet-runtime/.dotnet/7.0.9/dotnet
Activating C# + C# Dev Kit...
info: LanguageServerHost[0]
Starting server...
Dotnet path: /home/redacted/.config/Code/User/globalStorage/ms-dotnettools.vscode-dotnet-runtime/.dotnet/7.0.9/dotnet
Activating C# + C# Dev Kit...
info: LanguageServerHost[0]
Starting server...
Note that it's been half an hour from when I started it. .sln file:
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.5.002.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FunCon", "FunCon.csproj", "{190A5813-1162-45F9-9A5C-AAAAACF078B8}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{190A5813-1162-45F9-9A5C-AAAAACF078B8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{190A5813-1162-45F9-9A5C-AAAAACF078B8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{190A5813-1162-45F9-9A5C-AAAAACF078B8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{190A5813-1162-45F9-9A5C-AAAAACF078B8}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {05DB4D4D-B2F7-4C85-8990-E86FE4E8967B}
EndGlobalSection
EndGlobal
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.5.002.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FunCon", "FunCon.csproj", "{190A5813-1162-45F9-9A5C-AAAAACF078B8}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{190A5813-1162-45F9-9A5C-AAAAACF078B8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{190A5813-1162-45F9-9A5C-AAAAACF078B8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{190A5813-1162-45F9-9A5C-AAAAACF078B8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{190A5813-1162-45F9-9A5C-AAAAACF078B8}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {05DB4D4D-B2F7-4C85-8990-E86FE4E8967B}
EndGlobalSection
EndGlobal
.csproj file:
<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\tModLoader.targets" />
<PropertyGroup>
<AssemblyName>FunCon</AssemblyName>
<TargetFramework>net6.0</TargetFramework>
<PlatformTarget>AnyCPU</PlatformTarget>
<LangVersion>latest</LangVersion>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="tModLoader.CodeAssist" Version="0.1.*" />
</ItemGroup>
</Project>
<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\tModLoader.targets" />
<PropertyGroup>
<AssemblyName>FunCon</AssemblyName>
<TargetFramework>net6.0</TargetFramework>
<PlatformTarget>AnyCPU</PlatformTarget>
<LangVersion>latest</LangVersion>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="tModLoader.CodeAssist" Version="0.1.*" />
</ItemGroup>
</Project>
28 Replies
Burrito
Burrito12mo ago
Did you make that .csproj yourself?
PK™
PK™12mo ago
nope auto generated
Burrito
Burrito12mo ago
Well I don't think you are supposed to have the first <?xml ... line but I'm not certain. In your VS Code output, there should be another that says something about C# Dev Kit loading projects, check and see if it says something like the project is not supported.
PK™
PK™12mo ago
nuget maybe? it restores with no problems at all
Burrito
Burrito12mo ago
No not that.
PK™
PK™12mo ago
aight
Burrito
Burrito12mo ago
It's "Projects" in Output.
PK™
PK™12mo ago
2023-08-02 19:50:52.697 [info] Project system initialization finished. 1 project(s) are loaded, and 0 failed to load.
Burrito
Burrito12mo ago
Seems fine then. What doesn't work for you?
PK™
PK™12mo ago
C# dev kit output :
Starting Spawn .NET server...
Starting Open a solution...
Starting Open a solution with environment service...
Starting Clear environment...
.NET server started and IPC established in 3327ms
Completed Spawn .NET server (22992ms)
Completed Clear environment (23784ms)
Completed Open a solution with environment service (23876ms)
Starting Restore solution...
Completed Open a solution (23920ms)
Completed Restore solution (3481ms)
Starting Spawn .NET server...
Starting Open a solution...
Starting Open a solution with environment service...
Starting Clear environment...
.NET server started and IPC established in 3327ms
Completed Spawn .NET server (22992ms)
Completed Clear environment (23784ms)
Completed Open a solution with environment service (23876ms)
Starting Restore solution...
Completed Open a solution (23920ms)
Completed Restore solution (3481ms)
C# output:
Dotnet path: /home/neoncube/.config/Code/User/globalStorage/ms-dotnettools.vscode-dotnet-runtime/.dotnet/7.0.9/dotnet
Activating C# + C# Dev Kit...
info: LanguageServerHost[0]
Starting server...
Dotnet path: /home/neoncube/.config/Code/User/globalStorage/ms-dotnettools.vscode-dotnet-runtime/.dotnet/7.0.9/dotnet
Activating C# + C# Dev Kit...
info: LanguageServerHost[0]
Starting server...
it doesn't have any autocompletion whatsoever
Burrito
Burrito12mo ago
When you hover over some code, what do you see?
ZacharyPatten
ZacharyPatten12mo ago
You aren't giving us a lot of info to go on. It sounds like you are attempting to open a project in Visual Studio Code and it may be opening but the editing experience isn't what you are expecting? - Can you share the code in question? We can try to open it and see if there is something wrong with it. - Did you install .NET? Can you run a dotnet --info please and share the output? Follow 333Fred's instructions. He is expert 🙂
PK™
PK™12mo ago
as soon as I hovered over it, it gave the error I was talking about earlier I can't share the code, but I'll show the command ASAP brb
333fred
333fred12mo ago
Please set "dotnet.server.trace": "Trace" in your vscode settings and restart vscode, what is the output after that?
PK™
PK™12mo ago
Will do in about 30 minutes. I'm currently away.
333fred
333fred12mo ago
Ok, so talking with DavidB: this is exactly the expected behavior. Something else is going on if you're not getting semantic info. We'll still need the trace logging
PK™
PK™12mo ago
alright I'm back 10 minutes late lol you mean the .json?
333fred
333fred12mo ago
Yes, your settings.json
PK™
PK™12mo ago
PK™
PK™12mo ago
@333fred there you go
333fred
333fred12mo ago
What about in the new output C# LSP Trace logs output window that that setting added?
PK™
PK™12mo ago
It's a LOT of text
333fred
333fred12mo ago
Yes, it certainly is a lot of text 😄
PK™
PK™12mo ago
PK™
PK™12mo ago
This one's correct now that's a lot of damage text
333fred
333fred12mo ago
Hmm. Not seeing anything immediately obvious. Checking with the extension team Alright, we're not sure what's causing this. Can you please file a bug on the C# extension from the help window and they can work with you to figure out what's going on?
PK™
PK™12mo ago
quick update: making a project kinda works although not as intended
Accord
Accord12mo ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.