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

The reference assemblies for .NETFramework,Version=v4.8 were not found #4049

Closed
onionpsy opened this issue Sep 8, 2020 · 3 comments
Closed

Comments

@onionpsy
Copy link

onionpsy commented Sep 8, 2020

Environment data

.csproj contain <TargetFrameworkVersion>v4.8</TargetFrameworkVersion>

dotnet --info output:

.NET Core SDK (reflecting any global.json):
 Version:   3.1.402
 Commit:    9b5de826fd

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.18362
 OS Platform: Windows
 RID:         win10-x64
 Base Path:   E:\Program Files\dotnet\sdk\3.1.402\

Host (useful for support):
  Version: 3.1.8
  Commit:  9c1330dedd

.NET Core SDKs installed:
  2.1.517 [E:\Program Files\dotnet\sdk]
  2.1.518 [E:\Program Files\dotnet\sdk]
  3.1.402 [E:\Program Files\dotnet\sdk]

.NET Core runtimes installed:
  Microsoft.AspNetCore.All 2.1.21 [E:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.All 2.1.22 [E:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.App 2.1.21 [E:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 2.1.22 [E:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 3.1.8 [E:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 2.1.21 [E:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.1.22 [E:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 3.1.8 [E:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.WindowsDesktop.App 3.1.8 [E:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

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

VS Code version: 1.48.2
C# Extension version: 1.23.2

OmniSharp log

[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 'e:\DATA\Godot\Test' on host 6580.
[fail]: OmniSharp.MSBuild.ProjectLoader
        The reference assemblies for .NETFramework,Version=v4.8 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 'e:\DATA\Godot\Test\Test.csproj'.
e:\DATA\Godot\Test\Test.csproj
E:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(1177,5): Error: The reference assemblies for .NETFramework,Version=v4.8 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

Steps to reproduce

  • Install .NET 4.8 SDK + .NET targeting pack through Visual Studio Build Tools 2019 (16.7.3)
  • Open a C# project that require .NET 4.8
  • Install C#, C# tools for Godot extension on VScode,

I tried the workaround proposed here but same error.

Downgrading C# extension to 1.23.0 give me this error.

Godot has no problem building the project but I think it's an embedded Mono.

@jmarolf
Copy link

jmarolf commented Sep 29, 2020

If this only reproduces on Godot projects, I am going to assume that it is an issue with their targets files.

@leontancfa
Copy link

I got the exact same error, too, when I load other projects. I think this issue is not closed.

@JoeRobich
Copy link
Member

@leontancfa If you are using Windows and have VS or the Build Tools installed. I think you may need to do the following:

  1. Open the Visual Studio Installer.
  2. Choose to Modify your installation.
  3. Choose the Individual Components tab.
  4. Ensure that the 4.8 targeting pack is installed.
    image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants