Why installation of additional .NET SDK 5.0 (after SDK 2.1 was installed already) affected my solution, all projects of which have TargetFramework
either netstandard2.0
or netcoreapp2.1
? I expected, that I need only SDK 2.1. And installation of SDK 5.0 (I thought) should not affect this solution.
**
Below I will say about all effects that appeared in my solution after I installed .NET SDK 5.0
1. Projects appearance
So, as I said, I have a Visual Studio solution with some projects in it. All the projects have a TargetFramework
either netstandard2.0
or netcoreapp2.1
. I installed .NET SDK 2.1.818
(from here) (it was the only installed SDK at that moment).
1.a) When I opened the solution all dependencies had yellow warning sign. But it was no warnings in an "Error list":

Then I installed one more SDK: .NET SDK 5.0.408
(from here)
And all this signs are gone.
1.b) Also projects properties was displayed different:
Left - only SDK 2.1 is installed, Right - both 2.1 & 5.0 are installed

My question is - Why installing of SDK 5 affects the solution, all projects of which have a TargetFramework
either netstandard2.0
or netcoreapp2.1
?
May be it's caused somehow by the fact, (f.e.) that one of the nuGet-dependencies - Microsoft.CSharp (4.7.0)
has one of it's dependencies - .NETCore 5.0
:

**
2. Builds difference
But the main question is that build artifacts are not equal when I built the solution while only SDK 2.1 was installed compared with another build after SDK 5.0 was installed also. I compared build artifacts and the main differences are (I will call these two builds "2.1 build" and "5.0 build":
2.a) deps.jsons:
- All assemblies deps.jsons had
runtimeTarget
->signature
:
-2.1 build: NOT empty
-5.0 build: empty
- One of my assemblies deps.json had additional block about a couple of its dependency projects in
"targets"
->".NETCoreApp,Version=v2.1"
and in "libraries"
sections in 2.1 build, but had NOT this block at 5.0 build
!!: And in my case this difference caused another behaviour of the program
2.b) All jsons in projects obj
folders (e.g. project.assets.json
) had different:
- addersses of nuget:
-2.1 build: www.nuget.org/api/v2
-5.0 build: api.nuget.org/v3/index.json
-
- And different
"project"
->"frameworks"
->"netcoreapp2.1"
->"imports"
and "runtimeIdentifierGraphPath"
sections:
Left - 2.1 build (only SDK 2.1 is installed), Right - 5.0 build (both 2.1 & 5.0 are installed)

I'll repeat my question:
So, help me please to understand, why installation of additional SDK 5.0 had such effect? I expected, as all projects of solution have TargetFramework
either netstandard2.0
or netcoreapp2.1
, I need only SDK 2.1. And installation of SDK 5.0 (I expected) should not affect this solution.