1

Im getting the following error when running 'dotnet run' on my Mac OS/usr/local/share/dotnet/sdk/5.0.300/Microsoft.Common.CurrentVersion.targets(1216,5): error MSB3644: 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 [/Users/tommie/projects/zzz/zzz/zzz.csproj]

My code is from Visual Studio 8.9 and only supports up to 4.8 on the .net frameworks However when I look at the 'https://aka.ms/msbuild/developerpacks' 4.8 is not available. Only 5.0 is available. 5.0 is apparently supported in Visual Studio 8.10 but is not a formal release yet.

Tommie Jones
  • 957
  • 1
  • 16
  • 37
  • .NET Framework 4.8 developer pack is [here](https://dotnet.microsoft.com/download/dotnet-framework/thank-you/net48-developer-pack-offline-installer). The current release version of Visual Studio 2019 is 16.10. If you are creating a new project, you'd better use .NET 5.0 rather than .NET Framework of any version, because it is officially ended by MS. – Alsein Jun 01 '21 at 14:16
  • 1
    i'm sorry to ask, but aren't you mixing different things? .Net 5 is different than .Net Framework: https://stackoverflow.com/questions/38063837/whats-the-difference-between-net-core-net-framework-and-xamarin https://devblogs.microsoft.com/dotnet/introducing-net-5/ Plus, you are using .Net Framework on a Mac? The .NET Framework only supports the Windows operating system. – C-JARP Jun 01 '21 at 14:23
  • @C-JARP I probably am mixing different things. On Mac Visual Studio under project->options->general there is a selection for 'Target Framework' and the selection is '.net framework 4.8' – Tommie Jones Jun 01 '21 at 14:27
  • @Alsein Visual studio 2019 is 16.10 on windows but not mac – Tommie Jones Jun 01 '21 at 14:28
  • Note that Visual Studio for Mac is NOT Visual Studio, they are completely different things, so never call it 'Visual Studio'. You'd better use vscode instead. – Alsein Jun 01 '21 at 14:34

2 Answers2

2

I ran into this exact error on my Jenkins server performing a job using MSBUILD: error MSB3644: 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. There was some back and forth about Visual Studio and about MacOS which muddled things a little, but for me, installing ".NET Framework 4.8 Developer Pack Offline Installer" as suggested by Alsein corrected my problem. Link here https://dotnet.microsoft.com/en-us/download/dotnet-framework/thank-you/net48-developer-pack-offline-installer

Jeff Mergler
  • 1,384
  • 20
  • 27
0

fixed almost exactly same error in a project with around 20 dependent projects (and multiple target frameworks) by retargetting the parent project to target no higher frameworks than were targetted by any of child projects.

josh
  • 438
  • 4
  • 10