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.

Visual Studio Code for Unity: "The reference assemblies for .NETFramework,Version=v4.7.1 were not found. ... "

See original GitHub issue

Environment data

dotnet --info output:

.NET SDK (reflecting any global.json): Version: 5.0.102 Commit: 71365b4d42

Runtime Environment: OS Name: ubuntu OS Version: 20.04 OS Platform: Linux RID: ubuntu.20.04-x64 Base Path: /usr/share/dotnet/sdk/5.0.102/

Host (useful for support): Version: 5.0.2 Commit: cb5f173b96

.NET SDKs installed: 5.0.102 [/usr/share/dotnet/sdk]

.NET runtimes installed: Microsoft.AspNetCore.App 5.0.2 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.NETCore.App 5.0.2 [/usr/share/dotnet/shared/Microsoft.NETCore.App]

To install additional .NET runtimes or SDKs: https://aka.ms/dotnet-download

VS Code version: 1.52.1 C# Extension version: v1.23.8

OmniSharp log

Starting OmniSharp server at 1/15/2021, 4:21:50 PM Target: /home/simon_rober/CS02 - Introduction to Unity/CS02 - Introduction to Unity.sln

OmniSharp server started. Path: /home/simon_rober/.vscode/extensions/ms-dotnettools.csharp-1.23.8/.omnisharp/1.37.5/run PID: 38730

    Starting OmniSharp on ubuntu 20.4 (x64)
    DotNetPath set to dotnet
    Located 1 MSBuild instance(s)
        1: StandAlone 16.8.0 - "/home/simon_rober/.vscode/extensions/ms-dotnettools.csharp-1.23.8/.omnisharp/1.37.5/omnisharp/.msbuild/Current/Bin"
    MSBUILD_EXE_PATH environment variable set to '/home/simon_rober/.vscode/extensions/ms-dotnettools.csharp-1.23.8/.omnisharp/1.37.5/omnisharp/.msbuild/Current/Bin/MSBuild.exe'
    Registered MSBuild instance: StandAlone 16.8.0 - "/home/simon_rober/.vscode/extensions/ms-dotnettools.csharp-1.23.8/.omnisharp/1.37.5/omnisharp/.msbuild/Current/Bin"
        CscToolExe = csc.exe
        MSBuildToolsPath = /home/simon_rober/.vscode/extensions/ms-dotnettools.csharp-1.23.8/.omnisharp/1.37.5/omnisharp/.msbuild/Current/Bin
        CscToolPath = /home/simon_rober/.vscode/extensions/ms-dotnettools.csharp-1.23.8/.omnisharp/1.37.5/omnisharp/.msbuild/Current/Bin/Roslyn
        BypassFrameworkInstallChecks = true
        MSBuildExtensionsPath = /home/simon_rober/.vscode/extensions/ms-dotnettools.csharp-1.23.8/.omnisharp/1.37.5/omnisharp/.msbuild
    Detecting Cake files in '/home/simon_rober/CS02 - Introduction to Unity'.
    Could not find any Cake files
    Detecting projects in '/home/simon_rober/CS02 - Introduction to Unity/CS02 - Introduction to Unity.sln'.
    Queue project update for '/home/simon_rober/CS02 - Introduction to Unity/Assembly-CSharp.csproj'
    Detecting CSX files in '/home/simon_rober/CS02 - Introduction to Unity'.
    Could not find any CSX files
    Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.CSharpFormattingWorkspaceOptionsProvider, Order: 0
    Loading project: /home/simon_rober/CS02 - Introduction to Unity/Assembly-CSharp.csproj
    Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.Completion.CompletionOptionsProvider, Order: 0
    Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.RenameWorkspaceOptionsProvider, Order: 100
    Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.ImplementTypeWorkspaceOptionsProvider, Order: 110
    Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.BlockStructureWorkspaceOptionsProvider, Order: 140
    Configuration finished.
    Omnisharp server running using Stdio at location '/home/simon_rober/CS02 - Introduction to Unity' on host 38583.
    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
    Failed to load project file '/home/simon_rober/CS02 - Introduction to Unity/Assembly-CSharp.csproj'.

/home/simon_rober/CS02 - Introduction to Unity/Assembly-CSharp.csproj /home/simon_rober/.vscode/extensions/ms-dotnettools.csharp-1.23.8/.omnisharp/1.37.5/omnisharp/.msbuild/Current/Bin/Microsoft.Common.CurrentVersion.targets(1180,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: /home/simon_rober/CS02 - Introduction to Unity/Assembly-CSharp.csproj

Steps to reproduce

I desire to use unity and want to edit the C# files with VS Code on Ubuntu 20.04, hence I took a look at this tutorial: https://code.visualstudio.com/docs/other/unity

I installed .Net: dotnet --info: ".NET SDK (reflecting any global.json): Version: 5.0.102 Commit: 71365b4d42

Runtime Environment: OS Name: ubuntu OS Version: 20.04 OS Platform: Linux RID: ubuntu.20.04-x64 Base Path: /usr/share/dotnet/sdk/5.0.102/

Host (useful for support): Version: 5.0.2 Commit: cb5f173b96

.NET SDKs installed: 5.0.102 [/usr/share/dotnet/sdk]

.NET runtimes installed: Microsoft.AspNetCore.App 5.0.2 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.NETCore.App 5.0.2 [/usr/share/dotnet/shared/Microsoft.NETCore.App]

To install additional .NET runtimes or SDKs: https://aka.ms/dotnet-download"

Further I installed the C# extension to VS Code and managed to succesfully alter the External Script Editor to VS Code. By double clicking on the script in Unity, VS Code automatically openend with the script and the extra files as expected.

Expected behavior

intellisense should work and the extension should not fail.

Actual behavior

When I started to program I noticed that Intellisence for Unity does not work. There also appeared a the above error output.

Already tried:

I already tried to change " <TargetFrameworkVersion>v4.7.1</TargetFrameworkVersion>" to " <TargetFrameworkVersion>v5.0.2</TargetFrameworkVersion>" in the Assembly-CSharp.csproj file. This did not alter the behavior.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:12 (2 by maintainers)

github_iconTop GitHub Comments

25reactions
BlueDev5commented, Jan 16, 2021

I am also a unity User and the solution is pretty simple. Omnisharp is asking you to download the .net Framework Developers pack so that You can develop apps in C#. Here is the link to download it.

Hope this helps.😀

22reactions
DominicTobiascommented, Apr 6, 2021

For lost travelllers you need to set "omnisharp.useGlobalMono": "always" in VSCode settings otherwise it doesn’t work in Mac… seems like kind of an important thing but it’s tucked away in a Changelog.

And for Mac users you need to correct the version in .csproj, at the time of writing change it to 4.8 instead of 4.7.1.

Read more comments on GitHub >

github_iconTop Results From Across the Web

[VS Code] Error: The reference assemblies for framework ...
The reference assemblies for framework ".NETFramework,Version=v4.7.1" were not found. Intellisense (autocomplete) fix.
Read more >
Reference assemblies for framework ".NETFramework ...
The reference assemblies for .NETFramework,Version=v4.7.1 were not found. Close VS Code if it's already open. Download and Install .
Read more >
MSB3644: The reference assemblies for 'version' were not ...
This error occurs when the .NET reference assemblies are not found for the version of .NET that a project requests. The issue could...
Read more >
Reference Assemblies For Framework ... - ADocLib
I try to open a Unity3D project with VSCode under Linux Ubuntu 18.10.The omnisharp extension doesn't load the project saying assemblies were not...
Read more >
Visual Studio Code and Unity
Visual Studio Code can replace MonoDevelop as the editor for Unity. ... If you are installing VS Code for the first time, you...
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