VSCode + C# (OmiSharp) not showing any errors

筅森魡賤 提交于 2020-12-26 07:15:32

问题


I'm trying to find out why i'm not getting any help by omisharp in my visual studio code.

I've tried reinstalling both application and my extensions and i'm still having the problem.

Any ideas on what i might be missing? something I need to install?

// Alex


回答1:


Immediately after you have opened your application in VS Code, open the Output window (View > Output) and choose the OmniSharp Log in the Output window. That will provide more information about what is happening.




回答2:


OmniSharp works on the solution file. If the project is not added to a solution, then you will not see the errors.

Add project to the solution:

$ dotnet sln add SampleProject/SampleProject.csproj

Restart OmniSharp:

Press CTRL + SHIFT + P and select Omnisharp: Restart OmniSharp.




回答3:


It often happens because sometimes user by mistake disables the setting required for producing errors or problems. Just go to code > preferences > settings > Workspace settings and enable the required settings. It worked well for me, hope it does for you too.




回答4:


I spent some time figuring this out. I tried uninstalling extensions, uninstalling vs code itself, removing all app data files etc. The only simple solution was to file\open folder and browse to one of the folders of code you were working with and from there recreate you work-space as before by adding additional folders if needed. Once I did this all intellisense and error detection came back including go to definition.




回答5:


I solved my same problem clicking in the bottom right corner of VSCode, line sequence CRLF, changed to LF and then change again to CRLF.

After this, my problem was solved, but i need to make this every time a restart the computer.



来源:https://stackoverflow.com/questions/43957366/vscode-c-sharp-omisharp-not-showing-any-errors

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!