question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Omnisharp fails to load project file in VSCode with Unity

See original GitHub issue

Environment data

dotnet --info output: (ran from terminal - don’t believe I have this installed) zsh: command not found: dotnet VS Code version: 1.13.0 C# Extension version: 1.10.0 Mono version: mono --version Mono JIT compiler version 5.0.1.1 (2017-02/5077205 Thu May 18 16:11:37 EDT 2017) Copyright © 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com

Steps to reproduce

  1. Have Unity, VSCode, C# Extension, Mono installed.
  2. Open script from Unity. It will launch VSCode.
  3. Behavior described in Actual behavior occurs.

Expected behavior

Project should load correctly without error messages, provide intellisense.

Actual behavior

No Intellisense and VSCode prompts me with this message: WARN Some projects have trouble loading. Please review the output for more details.

Things I’ve tried:

  • Updated and reinstalled mono
  • Looked at other issues for this project, including #1031 . However, I’ve added mono to my path (see above) and it’s able to find it no problem.
  • Installing .NET Core. This didn’t seem to have any effect so uninstalled it. (that’s why dotnet --info from command line says it’s not found. Had it working earlier). Is this needed?

OmniSharp logs

Starting OmniSharp server at 6/12/2017, 8:22:41 AM
    Target: /Users/jarrods/fcgs/fcgs/src/FCGS/UnityClient/UnityClient.sln

OmniSharp server started wth Mono
    Path: /Users/jarrods/.vscode/extensions/ms-vscode.csharp-1.10.0/bin/run
    PID: 52221

OmniSharp: -s /Users/jarrods/fcgs/fcgs/src/FCGS/UnityClient/UnityClient.sln --hostPID 52196 --stdio DotNet:enablePackageRestore=false --encoding utf-8 --loglevel information formattingOptions:useTabs=false formattingOptions:tabSize=4 formattingOptions:indentationSize=4
{"Event":"log","Body":{"LogLevel":"INFORMATION","Name":"OmniSharp.Startup","Message":"Omnisharp server running using Stdio at location '/Users/jarrods/fcgs/fcgs/src/FCGS/UnityClient' on host 52196."},"Seq":1,"Type":"event"}
[info]: OmniSharp.DotNet.DotNetProjectSystem
        Initializing in /Users/jarrods/fcgs/fcgs/src/FCGS/UnityClient
[info]: OmniSharp.DotNet.DotNetProjectSystem
        Auto package restore: False
[info]: OmniSharp.DotNet.DotNetProjectSystem
        Update workspace context
[info]: OmniSharp.DotNet.DotNetProjectSystem
        Resolving projects references
[info]: OmniSharp.MSBuild.MSBuildProjectSystem
        MSBUILD_EXE_PATH environment variable set to /Users/jarrods/.vscode/extensions/ms-vscode.csharp-1.10.0/bin/omnisharp/msbuild/MSBuild.dll
[info]: OmniSharp.MSBuild.MSBuildProjectSystem
        MSBuildExtensionsPath environment variable set to /Users/jarrods/.vscode/extensions/ms-vscode.csharp-1.10.0/bin/omnisharp/msbuild
[info]: OmniSharp.MSBuild.MSBuildProjectSystem
        MSBuild will use local OmniSharp installation.
[info]: OmniSharp.MSBuild.MSBuildProjectSystem
        Detecting projects in '/Users/jarrods/fcgs/fcgs/src/FCGS/UnityClient/UnityClient.sln'.
[info]: OmniSharp.MSBuild.MSBuildProjectSystem
        Loading project: /Users/jarrods/fcgs/fcgs/src/FCGS/UnityClient/Assembly-CSharp.csproj
[fail]: OmniSharp.MSBuild.ProjectFile.ProjectFileInfo
        The reference assemblies for framework ".NETFramework,Version=v3.5" were not found. To resolve this, install the SDK or Targeting Pack for this framework version or retarget your application to a version of the framework for which you have the SDK or Targeting Pack installed. Note that assemblies will be resolved from the Global Assembly Cache (GAC) and will be used in place of reference assemblies. Therefore your assembly may not be correctly targeted for the framework you intend.
[warn]: OmniSharp.MSBuild.MSBuildProjectSystem
        Failed to load project file '/Users/jarrods/fcgs/fcgs/src/FCGS/UnityClient/Assembly-CSharp.csproj'.
/Users/jarrods/fcgs/fcgs/src/FCGS/UnityClient/Assembly-CSharp.csproj

[info]: OmniSharp.MSBuild.MSBuildProjectSystem
        Loading project: /Users/jarrods/fcgs/fcgs/src/FCGS/UnityClient/Assembly-CSharp-Editor.csproj
[fail]: OmniSharp.MSBuild.ProjectFile.ProjectFileInfo
        The reference assemblies for framework ".NETFramework,Version=v3.5" were not found. To resolve this, install the SDK or Targeting Pack for this framework version or retarget your application to a version of the framework for which you have the SDK or Targeting Pack installed. Note that assemblies will be resolved from the Global Assembly Cache (GAC) and will be used in place of reference assemblies. Therefore your assembly may not be correctly targeted for the framework you intend.
[warn]: OmniSharp.MSBuild.MSBuildProjectSystem
        Failed to load project file '/Users/jarrods/fcgs/fcgs/src/FCGS/UnityClient/Assembly-CSharp-Editor.csproj'.
/Users/jarrods/fcgs/fcgs/src/FCGS/UnityClient/Assembly-CSharp-Editor.csproj

[info]: OmniSharp.Script.ScriptProjectSystem
        Detecting CSX files in '/Users/jarrods/fcgs/fcgs/src/FCGS/UnityClient'.
[info]: OmniSharp.Script.ScriptProjectSystem
        Could not find any CSX files
[info]: OmniSharp.Startup
        Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.CSharpWorkspaceOptionsProvider
[info]: OmniSharp.Startup
        Configuration finished.

Thoughts on what’s wrong?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

3reactions
TobiasDevcommented, Oct 31, 2017

Hello,

I’ve updated to latest mono and I still get this error.

0reactions
DustinCampbellcommented, Oct 31, 2017

@TobiasDev : It’s probably better to file a new issue that necro a closed one.

Read more comments on GitHub >

github_iconTop Results From Across the Web

OmniSharp fails to load the Assembly-CSharp.csproj from a ...
Failed to load project file 'd:\Documents\GameDevelopment\UnityProjects\SimpleShooter\Assembly-CSharp.csproj'... [fail]: OmniSharp.MSBuild.
Read more >
Omnisharp not loading properly - Visual Studio Code and Unity
The most common solution is to make sure Mono is fully updated on your machine (https://mono-project.com/download/) and that you are running ...
Read more >
Visual Studio Code and Unity
In the VS Code Settings editor (Ctrl+,), uncheck the C# extension's Omnisharp: Use Modern Net setting ( "omnisharp.useModernNet": false ). Install Build Tools ......
Read more >
In Unity + VSCode, Fixed vscode intellisense not working.
When I created a new Unity 2020.3 LTS + VSCode environment and ... [warn]: OmniSharp.MSBuild.ProjectManager Failed to load project file ...
Read more >
Autocomplete in unity isn't working : r/Unity3D - Reddit
useGlobalMono":"always" in C# Extension for VS Code). [warn]: OmniSharp. ... Failed to load project file '/Users/myname/Unity Projects/FP ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found