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:
meta-question: is there a better place to ask what is probably a linux-specific tooling/build question?15 Replies
you're going to have a bad time trying to get .net 2 to play nicely with .net 4
rimworld, fwiw, requires .net 3.5
it's probably not that 2.0 is being included, but rather 4.x is
@sparr
Here's the top of the warnings
4.0 is being referenced from Rimworld stuff
2.0 is coming from... I don't know where
it seems to be saying that
/usr/lib/mono/2.0-api/mscorlib.dll
is an explicit project filerimworld uses .net 3.5 though
which might be the 2.0 mscorlib
what framework version are you targeting in your project?
that's what determines which mscorlib to pull in
I am not sure. How would I check?
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
Assembly-CSharp is the primary (only?) assembly for rimworld, and the warning says it depends on mscorlib 4.0.0.0.NET 3.5 apps use mscorlib 2.0:
You need to upgrade from .NET Framework 3.5
I don't think I chose that intentionally. It may have been auto generated or copied from another project. I doubt I'm using any 3.5-specific functionality.
However, I think other mods for this game are targeting 3.5, since the game uses 3.5(?), and folks compiling on other platforms don't get this error
All I can say is that 3.5 is extremely old
As @Cisien said, mixing 3.5 and 4.x projects is going to be a recipe for failure.
ok, I can see at least some other mods targeting newer frameworks
guess I'll bump up to 4.0 and see if I encounter problems
rimworld requires targeting 3.5
it won't work on 4
it's on a very old version of unity
you can try it
I dont think it's gone though an engine upgrade though
thanks for the insights!
this is a mod i made back in 2017... no clue if these settings work today though https://github.com/Cisien/NoMoreBreakdownNoise/blob/master/JustFixIt.csproj#L12
GitHub
NoMoreBreakdownNoise/JustFixIt.csproj at master · Cisien/NoMoreBrea...
Contribute to Cisien/NoMoreBreakdownNoise development by creating an account on GitHub.
✅ This post has been marked as answered!