Description
Hi,
I have attempted to migrate my C# solution (a set of projects) from .NET 5 to .NET 6 RC2 and I have also upgraded efcore to 6 RC2. However, now it happens that Microsoft.Extensions.DependencyInjection.Abstractions.dll
is not copied to the bin\debug\net6.0
in a test project (the test project contains "exes references" (#1675))
I have asked around and @rolfbjarne adviced to use:
dotnet build /bl:msbuild.binlog # + install https://msbuildlog.com/
to compare builds on .NET 5 and .NET 6 to find out differences. I did that and I have found out that GenerateDepsFile
task is in like each C# project mentioned in .NET 5 msbuild but that's not the case for .NET 6. This seems to be the difference. Is it possible that that's the reason why the Microsoft.Extensions.DependencyInjection.Abstractions.dll
is not copied to the output of my test project?
Also I can see in project.deps.json
(.NET 5):
"Microsoft.Extensions.DependencyInjection/5.0.2": {
"dependencies": {
"Microsoft.Extensions.DependencyInjection.Abstractions": "5.0.0"
},
"runtime": {
"lib/net5.0/Microsoft.Extensions.DependencyInjection.dll": {
"assemblyVersion": "5.0.0.1",
"fileVersion": "5.0.821.31504"
}
}
},
and in .NET 6, I can see
"Microsoft.Extensions.DependencyInjection/6.0.0-rc.2.21480.5": {
"dependencies": {
"Microsoft.Extensions.DependencyInjection.Abstractions": "6.0.0-rc.2.21480.5",
"System.Runtime.CompilerServices.Unsafe": "6.0.0-rc.2.21480.5"
}
},
(i.e. no "runtime" here)
But still I don't really know why Microsoft.Extensions.DependencyInjection.Abstractions.dll
is not copied to the output as a runtime library as my knowledge of msbuild is limited 😐
I have also tried to add <PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="6.0.0-rc.2.21480.5" />
to my testproject.csproj
file but it does not force to add the missing .dll file to the output.
I understand that nobody can really tell me what exactly is wrong because they would need a repro project (which I don't have, the solution is not trivial and I'm not even sure if I can separate out that specific issue). However, maybe you guys can tell me if there was any change that might have the consequences I'm observing. Or possibly an idea how to debug it more or how to work it around.
Thank you!
Regards,
Martin