-
Notifications
You must be signed in to change notification settings - Fork 700
On first getting started, cannot find dotnet
without a relaunch
#3461
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
Comments
dotnet
without a relaunchdotnet
without a relaunch
@JacksonKearl Correct. You will need to restart VS Code, this isn't really something this extension can do anything about - VS Code doesn't re-query the environment after the .NET Core installer adds it to the path. Is there anything that we could in either docs or this extension to better let you know that you need to restart Code? I have wondered before if maybe that error message should link to a troubleshooting page that talked about this scenario. |
I am on the VS Code team, can you explain where you'd expect the environment to be re-queried that isn't happening? I would expect you'd be able to trigger a re-query of the environment on opening a C# file or attempting to run/debug. |
First some background: there are lots of different tools that need to launch Now, if we wanted to support scenarios where the user installs a new SDK and it lights up in VS Code without a restart, we would need a new feature in VS Code to update the environment when it is modified by another installer (or the user). VS Code would need to monitor the various files that are used to modify the environment (if you are interested, we can find a .NET Core setup person to comment on how they do this to at least cover the ones they use) and re-query the environment when one of these files are modified and update all of the various VS Code processes. I think this is the code that VS Code uses to fetch the environment: getUnixShellEnvironment |
I see this each time the extension updates, with the Output for C# showing Restarting VS Code resolves. C# logInstalling C# dependencies...
Platform: darwin, x86_64
Downloading package 'OmniSharp for OSX' (44721 KB).................... Done! Downloading package '.NET Core Debugger (macOS / x64)' (51272 KB).................... Done! Downloading package 'Razor Language Server (macOS / x64)' (50263 KB).................... Done! Finished Failed to spawn 'dotnet --info' Environment informationVSCode version: 1.41.1 Mono InformationOmniSharp using global mono :6.4.0Dotnet Information.NET Core SDK (reflecting any global.json): Version: 3.0.100 Commit: 04339c3a26Runtime Environment: Host (useful for support): .NET Core SDKs installed: .NET Core runtimes installed: To install additional .NET Core runtimes or SDKs: Visual Studio Code Extensions
|
@incredibleweirdo That sounds like a separate issue, consider filing a new one. |
I am going to close this issue since it isn't really about this extension. Note that I am adding a help link to the error message that does mention this problem with #3507. |
When I'm first getting started with the extension and
dotnet
/C# in general, following https://docs.microsoft.com/en-us/dotnet/core/tutorials/with-visual-studio-code, I get these errors even after installingdotnet
and ensuring it is in my path. Upon relaunching (not reloading) VSCode, I was able to proceed. It seems the extension is not able to finddotnet
on my path if it was added during the session.Environment data
dotnet --info
output:.NET Core SDK (reflecting any global.json):
Version: 3.1.100
Commit: cd82f021f4
Runtime Environment:
OS Name: Mac OS X
OS Version: 10.14
OS Platform: Darwin
RID: osx.10.14-x64
Base Path: /usr/local/share/dotnet/sdk/3.1.100/
Host (useful for support):
Version: 3.1.0
Commit: 65f04fb6db
.NET Core SDKs installed:
3.1.100 [/usr/local/share/dotnet/sdk]
.NET Core runtimes installed:
Microsoft.AspNetCore.App 3.1.0 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 3.1.0 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
VS Code version: 1.41
C# Extension version: 1.21.9
The text was updated successfully, but these errors were encountered: