Skip to content
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

OmniSharp Intellisense Linux Ubuntu 20.04 does not works #4286

Closed
Serwur opened this issue Dec 9, 2020 · 4 comments
Closed

OmniSharp Intellisense Linux Ubuntu 20.04 does not works #4286

Serwur opened this issue Dec 9, 2020 · 4 comments
Labels

Comments

@Serwur
Copy link

Serwur commented Dec 9, 2020

Hey,

This is unity project. I open root folder where Assets, Library, Logs, Packages and ProjectSettings is located. I did it in past on Windows and everything worked as it should be.

What I have tried:

  1. Uninstall c# extenstion and install again, restart vscode
  2. Restart omnisharp f1 -> Restart Omnisharp

Any ideas?

Here is the log:

Starting OmniSharp server at 9.12.2020, 22:56:46
Target: /home/marcin/Dokumenty/unity-projects/project1

OmniSharp server started.
Path: /home/marcin/.vscode/extensions/ms-dotnettools.csharp-1.23.7/.omnisharp/1.37.4/run
PID: 34738

Starting OmniSharp on ubuntu 20.4 (x64)
info: OmniSharp.Services.DotNetCliService
DotNetPath set to dotnet
info: OmniSharp.MSBuild.Discovery.MSBuildLocator
Located 1 MSBuild instance(s)
1: StandAlone 16.8.0 - "/home/marcin/.vscode/extensions/ms-dotnettools.csharp-1.23.7/.omnisharp/1.37.4/omnisharp/.msbuild/Current/Bin"
info: OmniSharp.MSBuild.Discovery.MSBuildLocator
MSBUILD_EXE_PATH environment variable set to '/home/marcin/.vscode/extensions/ms-dotnettools.csharp-1.23.7/.omnisharp/1.37.4/omnisharp/.msbuild/Current/Bin/MSBuild.exe'
info: OmniSharp.MSBuild.Discovery.MSBuildLocator
Registered MSBuild instance: StandAlone 16.8.0 - "/home/marcin/.vscode/extensions/ms-dotnettools.csharp-1.23.7/.omnisharp/1.37.4/omnisharp/.msbuild/Current/Bin"
CscToolExe = csc.exe
MSBuildToolsPath = /home/marcin/.vscode/extensions/ms-dotnettools.csharp-1.23.7/.omnisharp/1.37.4/omnisharp/.msbuild/Current/Bin
CscToolPath = /home/marcin/.vscode/extensions/ms-dotnettools.csharp-1.23.7/.omnisharp/1.37.4/omnisharp/.msbuild/Current/Bin/Roslyn
BypassFrameworkInstallChecks = true
MSBuildExtensionsPath = /home/marcin/.vscode/extensions/ms-dotnettools.csharp-1.23.7/.omnisharp/1.37.4/omnisharp/.msbuild
info: OmniSharp.Cake.CakeProjectSystem
Detecting Cake files in '/home/marcin/Dokumenty/unity-projects/project1'.
info: OmniSharp.Cake.CakeProjectSystem
Could not find any Cake files
info: OmniSharp.MSBuild.ProjectSystem
No solution files found in '/home/marcin/Dokumenty/unity-projects/project1'
info: OmniSharp.Script.ScriptProjectSystem
Detecting CSX files in '/home/marcin/Dokumenty/unity-projects/project1'.
info: OmniSharp.Script.ScriptProjectSystem
Could not find any CSX files
info: OmniSharp.WorkspaceInitializer
Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.CSharpFormattingWorkspaceOptionsProvider, Order: 0
info: OmniSharp.WorkspaceInitializer
Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.Completion.CompletionOptionsProvider, Order: 0
info: OmniSharp.WorkspaceInitializer
Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.RenameWorkspaceOptionsProvider, Order: 100
info: OmniSharp.WorkspaceInitializer
Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.ImplementTypeWorkspaceOptionsProvider, Order: 110
info: OmniSharp.WorkspaceInitializer
Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.BlockStructureWorkspaceOptionsProvider, Order: 140
info: OmniSharp.WorkspaceInitializer
Configuration finished.
info: OmniSharp.Stdio.Host
Omnisharp server running using Stdio at location '/home/marcin/Dokumenty/unity-projects/project1' on host 34572.

@JoeRobich
Copy link
Member

@Serwur Sorry you are running into issues. Typically Unity will generate the solution and project files for your script assets. From the log ("No solution files found in '/home/marcin/Dokumenty/unity-projects/project1'") it seems like maybe Unity hasn't built these files. I believe if you open the project in Unity that will trigger them to generate.

@JoeRobich JoeRobich added the Unity label Dec 9, 2020
@Serwur
Copy link
Author

Serwur commented Dec 10, 2020

@JoeRobich
Thanks for tip. I had to create those files manually by going into Unity preferences. Actually it did work partially, because I didn't had "mono" installed and had to do other things aswell

Now everything works as expected.

To the point, for anyone who may has similar problems:

  1. The main problem - missing *.csproj files which weren't generated by Unity. To generate them, go to in opened Unity on Your project: Edit -> Preferences -> External Tools -> there You can find "Generate .csproj files for:". I've checked: Embedded, Local, Registry, Git and Built-in packages, because wasn't sure which exactly I was needed.

  2. Check if has installed newest mono version for Linux (in my case it's Ubuntu 20.04) by running in shell "mono --version". If not then You can find it at https://www.mono-project.com/download/stable/ - do every step

  3. Then I had with missing .NETFramework: "The reference assemblies for .NETFramework,Version=v4.7.1 were not found even installed". To install it using .exe file You need wine: "sudo apt-get install wine" - https://www.winehq.org . Then download required .NETFrameworks version or newer - https://dotnet.microsoft.com/download/dotnet-framework . Run in shell on downloaded .exe file: "wine ./NDP47-DevPack-KB3186612-ENU.exe" in my case.

  4. If You still has problem with missing reference, the last step is to change global property in VSC for omnisharp. Go to File -> Preferences -> Settings -> type in search field: "useglobalmono" and switch from "auto" to "always". Restart VSC. Let's may hope it works, for me it did. Generally this helped my aswell - https://stackoverflow.com/questions/54380924/reference-assemblies-for-framework-netframework-version-v4-7-1-were-not-found

@JoeRobich
Copy link
Member

@Serwur Glad things are working for you now. Step 3 in your list is unnecessary, since the reference assemblies are installed as part of the Mono installation. The reason you were seeing the warning was because useGlobalMono wasn't set to always. Sorry it displays a windows specific message even on other platforms.

@filipw
Copy link
Contributor

filipw commented Dec 10, 2020

Sorry it displays a windows specific message even on other platforms.

an issue tracking the improvement in this area is here OmniSharp/omnisharp-roslyn#2029

@Serwur Serwur closed this as completed Dec 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants