sparr
sparr
CC#
Created by sparr on 10/18/2022 in #help
.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?
14 replies
CC#
Created by sparr on 10/15/2022 in #help
VSCode extension can't find nuget packages
I restored a missing nuget package using msbuild and now I can use msbuild to compile my project without errors. However, the language server can't seem to find it so I get The type or namespace name 'whatever' could not be found (are you missing a using directive or an assembly reference?) as a Problem everywhere any part of that package is used. How can I tell the language server where nuget put the dll? (and how can I find that, in the first place?)
7 replies
CC#
Created by sparr on 10/15/2022 in #help
Can msbuild resolve parent directories from pwd instead of through ..?
I'm running msbuild while my working directory includes a symlink. When it tries to access ../../.. it is following the actual .. directory entry at each level which does up to the real parent of the symlinked directory, not to the parent of the symlink. Is there a way to get it to not do that?
2 replies
CC#
Created by sparr on 10/15/2022 in #help
Interpolating a csproj xml property in the text of another property?
<PropertyGroup Condition="$([MSBuild]::IsOSPlatform('Windows'))">
<DataFolder>Win64_Data</DataFolder>
</PropertyGroup>
<ItemGroup>
<Reference Include="Assembly-CSharp">
<HintPath>..\..\..\$(DataFolder)\Managed\Assembly-CSharp.dll</HintPath>
<Private>False</Private>
</Reference>
<PropertyGroup Condition="$([MSBuild]::IsOSPlatform('Windows'))">
<DataFolder>Win64_Data</DataFolder>
</PropertyGroup>
<ItemGroup>
<Reference Include="Assembly-CSharp">
<HintPath>..\..\..\$(DataFolder)\Managed\Assembly-CSharp.dll</HintPath>
<Private>False</Private>
</Reference>
Is something like this possible? I'm hoping I've just missed some available syntax for doing this sort of interpolation.
7 replies
CC#
Created by sparr on 10/13/2022 in #help
Why is mscorlib 2.0 an ExplicitReference in the Initial Items when running msbuild? [Answered]
I'm trying to build a project that has some dependencies on mscorlib version 4.0, but something about my build process is pulling in an implicit dependency on version 2.0 so I get a lot of warnings. warning MSB3277: Found conflicts between different versions of "mscorlib" that could not be resolved A possibly useful warning hint is this, which is confusing because I can't tell what's causing the primary setting/selection: "mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" was chosen because it was primary and "mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" was not. This is where I'm running msbuild, but the repo is very out of date and I'm working on bringing it up to date: https://github.com/sparr/rimworld-mod-DraggableCorners/tree/master/Source/DraggableCorners question: How can I determine what is causing v2.0 to get included? I've run msbuild -v:diag and find this in the Initial Items:
_ExplicitReference
/usr/lib/mono/2.0-api/mscorlib.dll
_ExplicitReference
/usr/lib/mono/2.0-api/mscorlib.dll
meta-question: is there a better place to ask what is probably a linux-specific tooling/build question?
33 replies