C
C#3y ago
sparr

.NETFramework 5.0 and 6.0 reference assemblies missing, but dotnet --list-sdks sees them [Answered]

Project "/home/sparr/src/Harmony/git/Harmony/Harmony.csproj" (2) is building "/home/sparr/src/Harmony/git/Harmony/Harmony.csproj" (2:8) on node 1 (Build target(s)).
/usr/lib/mono/msbuild/Current/bin/Microsoft.Common.CurrentVersion.targets(1232,5): error MSB3971: The reference assemblies for ".NETFramework,Version=v5.0" were not found. You might be using an older .NET SDK to target .NET 5.0 or higher. Update Visual Studio and/or your .NET SDK. [/home/sparr/src/Harmony/git/Harmony/Harmony.csproj]
Done Building Project "/home/sparr/src/Harmony/git/Harmony/Harmony.csproj" (Build target(s)) -- FAILED.
Project "/home/sparr/src/Harmony/git/Harmony/Harmony.csproj" (2) is building "/home/sparr/src/Harmony/git/Harmony/Harmony.csproj" (2:9) on node 1 (Build target(s)).
/usr/lib/mono/msbuild/Current/bin/Microsoft.Common.CurrentVersion.targets(1232,5): error MSB3971: The reference assemblies for ".NETFramework,Version=v6.0" were not found. You might be using an older .NET SDK to target .NET 5.0 or higher. Update Visual Studio and/or your .NET SDK. [/home/sparr/src/Harmony/git/Harmony/Harmony.csproj]
Done Building Project "/home/sparr/src/Harmony/git/Harmony/Harmony.csproj" (Build target(s)) -- FAILED.
Project "/home/sparr/src/Harmony/git/Harmony/Harmony.csproj" (2) is building "/home/sparr/src/Harmony/git/Harmony/Harmony.csproj" (2:8) on node 1 (Build target(s)).
/usr/lib/mono/msbuild/Current/bin/Microsoft.Common.CurrentVersion.targets(1232,5): error MSB3971: The reference assemblies for ".NETFramework,Version=v5.0" were not found. You might be using an older .NET SDK to target .NET 5.0 or higher. Update Visual Studio and/or your .NET SDK. [/home/sparr/src/Harmony/git/Harmony/Harmony.csproj]
Done Building Project "/home/sparr/src/Harmony/git/Harmony/Harmony.csproj" (Build target(s)) -- FAILED.
Project "/home/sparr/src/Harmony/git/Harmony/Harmony.csproj" (2) is building "/home/sparr/src/Harmony/git/Harmony/Harmony.csproj" (2:9) on node 1 (Build target(s)).
/usr/lib/mono/msbuild/Current/bin/Microsoft.Common.CurrentVersion.targets(1232,5): error MSB3971: The reference assemblies for ".NETFramework,Version=v6.0" were not found. You might be using an older .NET SDK to target .NET 5.0 or higher. Update Visual Studio and/or your .NET SDK. [/home/sparr/src/Harmony/git/Harmony/Harmony.csproj]
Done Building Project "/home/sparr/src/Harmony/git/Harmony/Harmony.csproj" (Build target(s)) -- FAILED.
and yet
$ dotnet --list-sdks
5.0.408 [/usr/share/dotnet/sdk]
6.0.108 [/usr/share/dotnet/sdk]
$ dotnet --list-sdks
5.0.408 [/usr/share/dotnet/sdk]
6.0.108 [/usr/share/dotnet/sdk]
What might I be missing to tell msbuild where to find these?
9 Replies
sparr
sparrOP3y ago
https://github.com/pardeike/Harmony/blob/master/Harmony/Harmony.csproj <TargetFrameworks>net35;net45;net472;net48;netcoreapp3.0;netcoreapp3.1;net5.0;net6.0</TargetFrameworks>
333fred
333fred3y ago
Dear lord why
sparr
sparrOP3y ago
this is a library, not mine, that targets as wide of coverage as possible I don't actually need to compile against all of those; I'd be happy to test with just one
333fred
333fred3y ago
How are you building this project?
sparr
sparrOP3y ago
msbuild
333fred
333fred3y ago
You can't use msbuild with .NET Core/5/6 If you need to use an msbuild command, use dotnet msbuild That will make sure you get the right things
sparr
sparrOP3y ago
thanks, that seems to have done the trick
333fred
333fred3y ago
Yw
Accord
Accord3y ago
✅ This post has been marked as answered!

Did you find this page helpful?