Closed tintoy closed 1 year ago
Published v0.4.4 of MSBuild Project Tools extension to the gallery.
@geniuskamo - here is the Codespace-enabled repository I've been testing with: https://github.com/tintoy/msbuild-project-tools-codespace-demo
Thank you @tintoy
Published v0.4.4 of MSBuild Project Tools extension to the gallery.
@geniuskamo - here is the Codespace-enabled repository I've been testing with: https://github.com/tintoy/msbuild-project-tools-codespace-demo
How do I use this ?
I'm also trying to run this, I'm using v0.4.5 inside a Dev Container. The language server doesn't appear to be working for me
This is what I see inside the dev tools
Are you on the latest version of the extension?
There is a setting to turn up the log level for MSBuild Project Tools - can you try setting that to “Verbose” and trying again?
I tried setting the logging level to verbose for the devcontainer.json and also the .vscode settings.json. It did not give any additional output other than what I screenshotted above. I am connecting to the dev container using VSCode's built in ssh client if that matters
Hmm - I can’t say I’ve seen that one before. I’ll have a look tonight after work and see if I can reproduce the problem.
Just out of curiosity, what is the output of dotnet --info
when run in that container?
The extension is executing within the container. My VSCode instance on the laptop is connecting to that container.
``` .NET SDK (reflecting any global.json): Version: 6.0.301 Commit: 43f9b18481 Runtime Environment: OS Name: debian OS Version: 11 OS Platform: Linux RID: debian.11-x64 Base Path: /usr/share/dotnet/sdk/6.0.301/ Host (useful for support): Version: 6.0.6 Commit: 7cca709db2 .NET SDKs installed: 6.0.301 [/usr/share/dotnet/sdk] .NET runtimes installed: Microsoft.AspNetCore.App 6.0.6 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.NETCore.App 6.0.6 [/usr/share/dotnet/shared/Microsoft.NETCore.App] To install additional .NET runtimes or SDKs: https://aka.ms/dotnet-download ```
``` .NET SDK (reflecting any global.json): Version: 6.0.106 Commit: 4f1e0330de Runtime Environment: OS Name: arch OS Version: OS Platform: Linux RID: arch-x64 Base Path: /usr/share/dotnet/sdk/6.0.106/ Host (useful for support): Version: 6.0.6 Commit: 7cca709db2 .NET SDKs installed: 6.0.106 [/usr/share/dotnet/sdk] .NET runtimes installed: Microsoft.AspNetCore.App 6.0.6 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.NETCore.App 6.0.6 [/usr/share/dotnet/shared/Microsoft.NETCore.App] To install additional .NET runtimes or SDKs: https://aka.ms/dotnet-download ```
``` .NET SDK (reflecting any global.json): Version: 6.0.107 Commit: f6ec7508e3 Runtime Environment: OS Name: arch OS Version: OS Platform: Linux RID: arch-x64 Base Path: /usr/share/dotnet/sdk/6.0.107/ global.json file: Not found Host: Version: 6.0.7 Architecture: x64 Commit: 0ec02c8c96 .NET SDKs installed: 6.0.107 [/usr/share/dotnet/sdk] .NET runtimes installed: Microsoft.NETCore.App 6.0.7 [/usr/share/dotnet/shared/Microsoft.NETCore.App] Download .NET: https://aka.ms/dotnet-download Learn about .NET Runtimes and SDKs: https://aka.ms/dotnet/runtimes-sdk-info ```
Sorry, one last question - what version of the extension is VSCode showing (both local and remote)?
Both local and remote have v0.4.5 installed
Ok - it looks like it’s failing because there is no global.json
section in the output (because the section names are localised, we have to count them in order to find the one we want). Interestingly, the output from your local machine does include this section but the container does not.
If you add a global.json
file to the solution directory you’re accessing in the container, does the output then include that section?
I’m trying to work out whether we have to somehow guess if that section is present or not…
Ok, it looks like they finally added support for directly listing SDKs and runtime versions:
I’ll have a go at switching over to using this instead of parsing the output of dotnet --info
(previously, this was the only way to discover SDK versions and their containing directories)…
If you create a pre-release I could test your change in my container
Sure no problem - will let you know as soon as I have something to test 🙂
Sorry, am still working on this - work has been a little hectic this week 🙂
Should be ready soon.
@loligans - can you try this build? I think the extension should now have a better chance at handling various forms of output from the dotnet
command-line tool, but the .NET-side code in the language server itself may still have issues.
Yes, how can I install it into my container? I don't see a new version when I choose "Install Another Version" in the extension settings
I tried going back to v0.4.4 and the language server works again. I will still try your build when it becomes available :)
Sorry, it's been a long day - I meant to upload the package as an attachment to that comment 😂
msbuild-project-tools-0.4.6-dev.zip
You may need to explicitly uninstall the extension version from the marketplace before you install from the VSIX package (Extensions -> Install from VSIX) and, afterwards, you can do the reverse to go back to automatic updates.
Haha no problem! I just tested your fix and its working!
Great - thanks for testing! I’ll make sure nothing else is broken and then publish a new version of the extension to the gallery.
Published v0.4.6 of the extension to the gallery (the .NET-side language server implementation is also more robust now).
Latest version running in the container gives me this exception:
Starting MSBuild language service...
Failed to start the MSBuild language server.
Error: Command failed: "/usr/bin/dotnet" "/home/loligans/.vscode-server/extensions/tintoy.msbuild-project-tools-0.4.6/out/language-server/MSBuildProjectTools.LanguageServer.Host.dll" --probe
System.ArgumentException: '' is not a valid version string. (Parameter 'value')
at NuGet.Versioning.SemanticVersion.Parse(String value)
at MSBuildProjectTools.LanguageServer.Utilities.DotNetRuntimeInfo.ParseDotNetVersionOutput(TextReader dotnetVersionOutput) in D:\Development\github\tintoy\msbuild-project-tools-vscode\lib\server\src\LanguageServer.Common\Utilities\DotNetRuntimeInfo.cs:line 140
at MSBuildProjectTools.LanguageServer.Utilities.DotNetRuntimeInfo.GetCurrent(String baseDirectory, ILogger logger) in D:\Development\github\tintoy\msbuild-project-tools-vscode\lib\server\src\LanguageServer.Common\Utilities\DotNetRuntimeInfo.cs:line 69
at MSBuildProjectTools.LanguageServer.Utilities.MSBuildHelper.DiscoverMSBuildEngine(String baseDirectory, ILogger logger) in D:\Development\github\tintoy\msbuild-project-tools-vscode\lib\server\src\LanguageServer.Common\Utilities\MSBuildHelper.cs:line 96
at MSBuildProjectTools.LanguageServer.Program.Main() in D:\Development\github\tintoy\msbuild-project-tools-vscode\lib\server\src\LanguageServer\Program.cs:line 39
System.ArgumentException: '' is not a valid version string. (Parameter 'value')
at NuGet.Versioning.SemanticVersion.Parse(String value)
at MSBuildProjectTools.LanguageServer.Utilities.DotNetRuntimeInfo.ParseDotNetVersionOutput(TextReader dotnetVersionOutput) in D:\Development\github\tintoy\msbuild-project-tools-vscode\lib\server\src\LanguageServer.Common\Utilities\DotNetRuntimeInfo.cs:line 140
at MSBuildProjectTools.LanguageServer.Utilities.DotNetRuntimeInfo.GetCurrent(String baseDirectory, ILogger logger) in D:\Development\github\tintoy\msbuild-project-tools-vscode\lib\server\src\LanguageServer.Common\Utilities\DotNetRuntimeInfo.cs:line 69
at MSBuildProjectTools.LanguageServer.Utilities.MSBuildHelper.DiscoverMSBuildEngine(String baseDirectory, ILogger logger) in D:\Development\github\tintoy\msbuild-project-tools-vscode\lib\server\src\LanguageServer.Common\Utilities\MSBuildHelper.cs:line 96
at MSBuildProjectTools.LanguageServer.Program.Main() in D:\Development\github\tintoy\msbuild-project-tools-vscode\lib\server\src\LanguageServer\Program.cs:line 39
I think I spoke too soon, sorry. I simply rebuilt the container and it started working again. I appreciate your awesome work by supporting this extension! If you had a sponsor link for the project where I could donate to support, I would definitely like to do that
What do you get when you run dotnet --version
in the container?
All good, I'm just relieved that it's working for you 🙂
I'll try to improve the error message though.
See https://code.visualstudio.com/api/advanced-topics/remote-extensions and https://code.visualstudio.com/api/advanced-topics/extension-host for details