Open heaversm opened 5 years ago
@heaversm You need to install mono (https://www.mono-project.com/download/stable/#download-mac). I recommend installing version 5.18 from that page instead of using homebrew/etc package managers. (copied from https://github.com/OmniSharp/omnisharp-vscode/issues/2555#issuecomment-456998688)
I installed mono: mono --version
: Mono JIT compiler version 5.16.0.221
. I believe at this point I have tried both brew and a direct download - do you know how to use the version over the brew version?
Did you install Mono framework and .net core, if so write on your terminal below: export FrameworkPathOverride=/Library/Frameworks/Mono.framework/Versions/Current
I know I'm resurrecting a year old thread, but I'm running into the same issue. I have latest mono installed, I've exported FrameworkPathOverride, but I still end up with the same error.
@jscheel can you share the OmniSharp Log from the project you are working on?
can you share the OmniSharp Log from the project you are working on?
Same issue =\
https://github.com/OmniSharp/omnisharp-vscode/issues/3063#issuecomment-642598877
Starting OmniSharp server at 6/11/2020, 3:26:22 PM
Target: /Users/dtx/Dev/_unity/myProject/MyProject/MyProject.sln
OmniSharp server started.
Path: /Users/dtx/.vscode/extensions/ms-dotnettools.csharp-1.22.0/.omnisharp/1.35.2/run
PID: 575
[info]: OmniSharp.Stdio.Host
Starting OmniSharp on MacOS 10.14.6 (x64)
[info]: OmniSharp.Services.DotNetCliService
DotNetPath set to dotnet
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
Located 1 MSBuild instance(s)
1: StandAlone 16.4 - "/Users/dtx/.vscode/extensions/ms-dotnettools.csharp-1.22.0/.omnisharp/1.35.2/omnisharp/.msbuild/Current/Bin"
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
MSBUILD_EXE_PATH environment variable set to '/Users/dtx/.vscode/extensions/ms-dotnettools.csharp-1.22.0/.omnisharp/1.35.2/omnisharp/.msbuild/Current/Bin/MSBuild.dll'
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
Registered MSBuild instance: StandAlone 16.4 - "/Users/dtx/.vscode/extensions/ms-dotnettools.csharp-1.22.0/.omnisharp/1.35.2/omnisharp/.msbuild/Current/Bin"
CscToolExe = csc.exe
MSBuildToolsPath = /Users/dtx/.vscode/extensions/ms-dotnettools.csharp-1.22.0/.omnisharp/1.35.2/omnisharp/.msbuild/Current/Bin
CscToolPath = /Users/dtx/.vscode/extensions/ms-dotnettools.csharp-1.22.0/.omnisharp/1.35.2/omnisharp/.msbuild/Current/Bin/Roslyn
BypassFrameworkInstallChecks = true
MSBuildExtensionsPath = /Users/dtx/.vscode/extensions/ms-dotnettools.csharp-1.22.0/.omnisharp/1.35.2/omnisharp/.msbuild
[info]: OmniSharp.Cake.CakeProjectSystem
Detecting Cake files in '/Users/dtx/Dev/_unity/myProject/MyProject'.
[info]: OmniSharp.Cake.CakeProjectSystem
Could not find any Cake files
[info]: OmniSharp.MSBuild.ProjectSystem
Detecting projects in '/Users/dtx/Dev/_unity/myProject/MyProject/MyProject.sln'.
[info]: OmniSharp.MSBuild.ProjectManager
Queue project update for '/Users/dtx/Dev/_unity/myProject/MyProject/Assembly-CSharp.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
Queue project update for '/Users/dtx/Dev/_unity/myProject/MyProject/Assembly-CSharp-Editor.csproj'
[info]: OmniSharp.Script.ScriptProjectSystem
Detecting CSX files in '/Users/dtx/Dev/_unity/myProject/MyProject'.
[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.MSBuild.ProjectManager
Loading project: /Users/dtx/Dev/_unity/myProject/MyProject/Assembly-CSharp.csproj
[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 '/Users/dtx/Dev/_unity/myProject/MyProject' on host 558.
[fail]: OmniSharp.MSBuild.ProjectLoader
The reference assemblies for .NETFramework,Version=v4.7.1 were not found. To resolve this, install the Developer Pack (SDK/Targeting Pack) for this framework version or retarget your application. You can download .NET Framework Developer Packs at https://aka.ms/msbuild/developerpacks
[warn]: OmniSharp.MSBuild.ProjectManager
Failed to load project file '/Users/dtx/Dev/_unity/myProject/MyProject/Assembly-CSharp.csproj'.
/Users/dtx/Dev/_unity/myProject/MyProject/Assembly-CSharp.csproj
/Users/dtx/.vscode/extensions/ms-dotnettools.csharp-1.22.0/.omnisharp/1.35.2/omnisharp/.msbuild/Current/Bin/Microsoft.Common.CurrentVersion.targets(1193,5): Error: The reference assemblies for .NETFramework,Version=v4.7.1 were not found. To resolve this, install the Developer Pack (SDK/Targeting Pack) for this framework version or retarget your application. You can download .NET Framework Developer Packs at https://aka.ms/msbuild/developerpacks
[info]: OmniSharp.MSBuild.ProjectManager
Loading project: /Users/dtx/Dev/_unity/myProject/MyProject/Assembly-CSharp-Editor.csproj
[fail]: OmniSharp.MSBuild.ProjectLoader
The reference assemblies for .NETFramework,Version=v4.7.1 were not found. To resolve this, install the Developer Pack (SDK/Targeting Pack) for this framework version or retarget your application. You can download .NET Framework Developer Packs at https://aka.ms/msbuild/developerpacks
[warn]: OmniSharp.MSBuild.ProjectManager
Failed to load project file '/Users/dtx/Dev/_unity/myProject/MyProject/Assembly-CSharp-Editor.csproj'.
/Users/dtx/Dev/_unity/myProject/MyProject/Assembly-CSharp-Editor.csproj
/Users/dtx/.vscode/extensions/ms-dotnettools.csharp-1.22.0/.omnisharp/1.35.2/omnisharp/.msbuild/Current/Bin/Microsoft.Common.CurrentVersion.targets(1193,5): Error: The reference assemblies for .NETFramework,Version=v4.7.1 were not found. To resolve this, install the Developer Pack (SDK/Targeting Pack) for this framework version or retarget your application. You can download .NET Framework Developer Packs at https://aka.ms/msbuild/developerpacks
[fail]: OmniSharp.MSBuild.ProjectManager
Attempted to update project that is not loaded: /Users/dtx/Dev/_unity/myProject/MyProject/Assembly-CSharp.csproj
[fail]: OmniSharp.MSBuild.ProjectManager
Attempted to update project that is not loaded: /Users/dtx/Dev/_unity/myProject/MyProject/Assembly-CSharp-Editor.csproj
Try adding export FrameworkPathOverride=/Library/Frameworks/Mono.framework/Versions/Current
to your ~/.bash_profile
or ~/.zshrc
or whichever terminal you use. Restart VSCode before trying again.
@bmschwartz You are my hero! When I moved FrameworkPathOverride from the global PATH to .bash_profile, OmniSharp started with no errors
Glad I could help. I spent a few hours trying to figure it out as well.
@bmschwartz Bro, you're like an archangel bringing this solution to us!
Try adding
export FrameworkPathOverride=/Library/Frameworks/Mono.framework/Versions/Current
to your~/.bash_profile
or~/.zshrc
or whichever terminal you use. Restart VSCode before trying again.
That worked for me too! Thank you very much!
Try adding
export FrameworkPathOverride=/Library/Frameworks/Mono.framework/Versions/Current
to your~/.bash_profile
or~/.zshrc
or whichever terminal you use. Restart VSCode before trying again.
Worked for me on ubuntu 20.04 I added the line to my ~/.bashrc and the restarted visual studio code
Thanks a lot!!
@bmschwartz that was it! Thanks!
How can that possibly work on Ubuntu 20.04? It is a MacOS path to mono framework which does not exist on Ubuntu.
Try adding
export FrameworkPathOverride=/Library/Frameworks/Mono.framework/Versions/Current
to your~/.bash_profile
or~/.zshrc
or whichever terminal you use. Restart VSCode before trying again.
this is it, thanks @bmschwartz .
Just clarifying that for me I needed to put this "export FrameworkPathOverride=/Library/Frameworks/Mono.framework/Versions/Current" to ~/.bash_profile.
I dont use bash as my shell, but seems it is loading it from there anyway on macOS.
Environment data
dotnet --info
output: 2.2.1 VS Code version: C# Extension version: 1.17.1Steps to reproduce
Try to use the Unity Debugger. Error gets thrown in VSCode
Expected behavior
No errors
Actual behavior
Errors on startup
The .NETFramework is not available on a Mac. I'm not sure if it is needed for this extension - if it is, the extension is useless on Mac. If it is not, there should be a check for the platform or something. Regardless, if I try to debug Unity, it crashes as soon as I hit play (
Debug adapter process has terminated unexpectedly (spawn mono ENOENT)