When I run dotnet build
on my code from my WSL (Windows Subsystem for Linux) distro, C# intellisense breaks and I get errors like the following:
I've managed to set up the launch configurations found here, but that doesn't help with Intellisense, unless I've missed something.
I presume it has something to do with path configurations, but I'm not sure what to change, or where I should change it.
In short, how can I compile and run my code on WSL and edit it in VS Code without errors or warnings?
Troubleshooting# If you find IntelliSense has stopped working, the language service may not be running. Try restarting VS Code and this should solve the issue. If you are still missing IntelliSense features after installing a language extension, open an issue in the repository of the language extension.
Click f1 key or ctrl+shift+p to open the textbox to enter your command. Then type omnisharp server, and select the option 'Restart omnisharp server'. You can look at its status in the bottom left corner of the window, and if you click on it, the process's status will on be displayed on the terminal.
As I fell into this question when I looked for this problem I decided to go back to show how I managed to solve it.
To OmniSharp work with WSL i installed the Insiders version of VS Code and the extension Remote - WSL
.
Done.
Links:
OBS: You have to install on your WSL Linux distro the wget
and msbuild
There are more possible solutions:
Your folder structure is not correct:
mkdir MyProject
dotnet new console
Wrong Settings:
Go to:
Code -> Preferences -> Settings
and remove "omnisharp.useMono": true/false
Additionally, you can open your project with Visual Studio or MonoDevelop and then reopen in VSCode.
You have wrong input parameters in your TryParseExact
#LAUGHING
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With