-
Notifications
You must be signed in to change notification settings - Fork 671
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
Assemblies targeting .Net Framework 4.7.1 fail to load on Mac, plugin v1.21.11 #3613
Comments
@edwardrowe The built-in mono does not contain reference assemblies. To fix this problem you should install the stable mono - https://www.mono-project.com/download/stable/#download-mac |
This worked. Thanks so much for the help and quick feedback. |
I did, but it didn't help. |
@DTX-92 Can you share the omnisharp log from the Output pane? |
I was able to fix a problem by modifying my ~/.bash_profile to contain |
In my case, I have reinstalled the previous version of omnisharp plugin then it worked Another way to fix the issue without downgrade omnisharp plugin is to update the latest mono (https://www.mono-project.com/download/stable/). |
you don't need to revert - see #4007 (comment) |
Unity 2020.1.9f1 Personal, MacOS Catalina 10.15.7 (19H2) and the problem persists on versions >1.23.0 :/ |
@hypeofpipe Sorry you are running into issues. The minimal Mono shipped with the C# extension does not contain 4.7.1 reference assemblies. Install the latest stable Mono 6.12.0 from https://www.mono-project.com/download/stable/ and set the |
@giangchau92 's solution worked for me. Using homebrew I installed dotnet-sdk and mono, then I installed the C# extension in VSCode and had the error in the thread's title. The plugin was at version 1.23.5, I installed version 1.23.4 and now I get no errors in the OmniSharp's log and intellisense works. Omnisharp.log at start:
|
Thank you!! I am using Unity 2019.4.14f1 on MacOS Catalina 10.15.7, and I noticed the package for "VSCode Editor" was on older version 1.2.2. Upgrading to 1.2.3 fixed it. OmniSharp' debug message is also not terribly helpful because AFAIK there is no .Net Framework 4.7.1 built for Mac. So what would help me debug this issue is knowing what are the responsible parties for this framework version determination. Is it Unity? Is it VSCode Editor? Is it maybe a solution misconfiguration with a default resolving to 4.7.1? I know OmniSharp package isn't directly in charge of these other projects, and it's important to maintain some idempotency between them. However the reality is 99.9% of users encountering this major error are coming from a Unity on Mac environment. Some from Unity on Linux too. Therefore, some awareness of how Unity interoperates with OmniSharp and VSCode would all be very much more helpful. Maybe even provide a URL tip to a OmniSharp wiki page with up-to-date information on this common issue. Also, Unity needs to do some sanity checking for developer work environments. Something really smart for Mac developers that checks and suggests what are working configurations. |
Man.. i want to hug you! I've been fighting 3 days with it and just changed to use mono always. IT'S WORKING |
That "Global Mono to always" setting in VS Code was the thing I missed on the first try. Just installing the latest mono alone didn't do it. Thanks @giangchau92 ! |
This does not work if you install the .Net Runtimes 5.x. Basically now this omnisharp no longer performs syntax checking on C# files, and now way to fix. |
@steowens OmniSharp's built-in Mono supports .NET 5.0, however the global Mono doesn't (there is no official Mono release that ships with MSBuild 16.8 which is required for .NET 5.0). We are waiting already several months for the relevant official Mono release mono/mono#20250 |
At first I couldn't find this setting in vscode - it is not in Workspace settings but only in the User tab. Works like a charm though! |
I've tried many stuff. Changing to always this config worked for me ! Thanks! Now I can see Intellisense in VS from Unity C# files! (Linux mint 19.3) |
Please use the solution described here #3613 (comment), otherwise - please open a new issue, thanks. |
Issue Description
When loading my Unity (v2018.4.2f) project in Visual Studio Code, the assemblies fail to load and intellisense doesn't work. This seems to have been introduced in version 1.21.11, as rolling back to v1.21.10 works fine.
Steps to Reproduce
Expected Behavior
The assemblies should load, allowing me to see function references and Go To implementations and definitions.
Actual Behavior
Intellisense and
Logs
OmniSharp log
Starting OmniSharp server at 2/27/2020, 3:58:25 PM
Target: /Users/erowe/Development/sparklite/sparklite.sln
OmniSharp server started.
Path: /Users/erowe/.vscode/extensions/ms-vscode.csharp-1.21.11/.omnisharp/1.34.11/run
PID: 26956
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.3 - "/Users/erowe/.vscode/extensions/ms-vscode.csharp-1.21.11/.omnisharp/1.34.11/omnisharp/.msbuild/Current/Bin"
info: OmniSharp.MSBuild.Discovery.MSBuildLocator
MSBUILD_EXE_PATH environment variable set to '/Users/erowe/.vscode/extensions/ms-vscode.csharp-1.21.11/.omnisharp/1.34.11/omnisharp/.msbuild/Current/Bin/MSBuild.dll'
info: OmniSharp.MSBuild.Discovery.MSBuildLocator
Registered MSBuild instance: StandAlone 16.3 - "/Users/erowe/.vscode/extensions/ms-vscode.csharp-1.21.11/.omnisharp/1.34.11/omnisharp/.msbuild/Current/Bin"
CscToolExe = csc.exe
MSBuildToolsPath = /Users/erowe/.vscode/extensions/ms-vscode.csharp-1.21.11/.omnisharp/1.34.11/omnisharp/.msbuild/Current/Bin
CscToolPath = /Users/erowe/.vscode/extensions/ms-vscode.csharp-1.21.11/.omnisharp/1.34.11/omnisharp/.msbuild/Current/Bin/Roslyn
BypassFrameworkInstallChecks = true
MSBuildExtensionsPath = /Users/erowe/.vscode/extensions/ms-vscode.csharp-1.21.11/.omnisharp/1.34.11/omnisharp/.msbuild
info: OmniSharp.Cake.CakeProjectSystem
Detecting Cake files in '/Users/erowe/Development/sparklite'.
info: OmniSharp.Cake.CakeProjectSystem
Could not find any Cake files
info: OmniSharp.MSBuild.ProjectSystem
Detecting projects in '/Users/erowe/Development/sparklite/sparklite.sln'.
info: OmniSharp.MSBuild.ProjectManager
Queue project update for '/Users/erowe/Development/sparklite/Assembly-CSharp.csproj'
info: OmniSharp.MSBuild.ProjectManager
Queue project update for '/Users/erowe/Development/sparklite/Assembly-CSharp-firstpass.csproj'
info: OmniSharp.MSBuild.ProjectManager
Queue project update for '/Users/erowe/Development/sparklite/Assembly-CSharp-Editor.csproj'
info: OmniSharp.MSBuild.ProjectManager
Queue project update for '/Users/erowe/Development/sparklite/Assembly-CSharp-Editor-firstpass.csproj'
info: OmniSharp.MSBuild.ProjectManager
Queue project update for '/Users/erowe/Development/sparklite/RBG.Mulligan.csproj'
info: OmniSharp.Script.ScriptProjectSystem
Detecting CSX files in '/Users/erowe/Development/sparklite'.
info: OmniSharp.MSBuild.ProjectManager
Loading project: /Users/erowe/Development/sparklite/Assembly-CSharp.csproj
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.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.EditorConfigWorkspaceOptionsProvider, Order: 200
info: OmniSharp.WorkspaceInitializer
Configuration finished.
info: OmniSharp.Stdio.Host
Omnisharp server running using Stdio at location '/Users/erowe/Development/sparklite' on host 26922.
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/erowe/Development/sparklite/Assembly-CSharp.csproj'.
/Users/erowe/Development/sparklite/Assembly-CSharp.csproj
/Users/erowe/.vscode/extensions/ms-vscode.csharp-1.21.11/.omnisharp/1.34.11/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
Loading project: /Users/erowe/Development/sparklite/Assembly-CSharp-firstpass.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/erowe/Development/sparklite/Assembly-CSharp-firstpass.csproj'.
/Users/erowe/Development/sparklite/Assembly-CSharp-firstpass.csproj
/Users/erowe/.vscode/extensions/ms-vscode.csharp-1.21.11/.omnisharp/1.34.11/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
Loading project: /Users/erowe/Development/sparklite/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/erowe/Development/sparklite/Assembly-CSharp-Editor.csproj'.
/Users/erowe/Development/sparklite/Assembly-CSharp-Editor.csproj
/Users/erowe/.vscode/extensions/ms-vscode.csharp-1.21.11/.omnisharp/1.34.11/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
Loading project: /Users/erowe/Development/sparklite/Assembly-CSharp-Editor-firstpass.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/erowe/Development/sparklite/Assembly-CSharp-Editor-firstpass.csproj'.
/Users/erowe/Development/sparklite/Assembly-CSharp-Editor-firstpass.csproj
/Users/erowe/.vscode/extensions/ms-vscode.csharp-1.21.11/.omnisharp/1.34.11/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
Loading project: /Users/erowe/Development/sparklite/RBG.Mulligan.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/erowe/Development/sparklite/RBG.Mulligan.csproj'.
/Users/erowe/Development/sparklite/RBG.Mulligan.csproj
/Users/erowe/.vscode/extensions/ms-vscode.csharp-1.21.11/.omnisharp/1.34.11/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
Attempted to update project that is not loaded: /Users/erowe/Development/sparklite/Assembly-CSharp.csproj
fail: OmniSharp.MSBuild.ProjectManager
Attempted to update project that is not loaded: /Users/erowe/Development/sparklite/Assembly-CSharp-firstpass.csproj
fail: OmniSharp.MSBuild.ProjectManager
Attempted to update project that is not loaded: /Users/erowe/Development/sparklite/Assembly-CSharp-Editor.csproj
fail: OmniSharp.MSBuild.ProjectManager
Attempted to update project that is not loaded: /Users/erowe/Development/sparklite/Assembly-CSharp-Editor-firstpass.csproj
fail: OmniSharp.MSBuild.ProjectManager
Attempted to update project that is not loaded: /Users/erowe/Development/sparklite/RBG.Mulligan.csproj
C# log
Installing C# dependencies...
Platform: darwin, x86_64
Downloading package 'OmniSharp for OSX' (46346 KB).................... Done!
Validating download...
Integrity Check succeeded.
Installing package 'OmniSharp for OSX'
Downloading package '.NET Core Debugger (macOS / x64)' (41849 KB).................... Done!
Validating download...
Integrity Check succeeded.
Installing package '.NET Core Debugger (macOS / x64)'
Downloading package 'Razor Language Server (macOS / x64)' (50424 KB).................... Done!
Installing package 'Razor Language Server (macOS / x64)'
Finished
Environment information
VSCode version: 1.42.1
C# Extension: 1.21.11
Mono Information
OmniSharp using built-in monoDotnet Information
.NET Core SDK (reflecting any global.json): Version: 2.1.401 Commit: 91b1c13032Runtime Environment:
OS Name: Mac OS X
OS Version: 10.14
OS Platform: Darwin
RID: osx-x64
Base Path: /usr/local/share/dotnet/sdk/2.1.401/
Host (useful for support):
Version: 2.1.3
Commit: 124038c13e
.NET Core SDKs installed:
2.1.401 [/usr/local/share/dotnet/sdk]
.NET Core runtimes installed:
Microsoft.AspNetCore.All 2.1.3 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.All]
Microsoft.AspNetCore.App 2.1.3 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 2.1.3 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
To install additional .NET Core runtimes or SDKs:
https://aka.ms/dotnet-download
Visual Studio Code Extensions
The text was updated successfully, but these errors were encountered: