简体   繁体   中英

dotnet run reporting '.NETFramework,Version=v4.8 were not found'

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] 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.

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 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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM