0

I have a solution which is to be built in net6.0 and netstandard2.0. I have been using the command

dotnet publish <path to solution> /p:Configuration=Release -o <binrel\net6.0> -v detailed --framework net6.0

And the same solution is built in netstandard as well. The dependencies are referenced from respective framework folders as well. There is an indirect package reference of System.Private.ServiceModel.dll for net6.0 which should be picked from the net6.0 folder and another version of the same for netstandard build from netstandard folder. But the issue is, netstandard file is being considered for net6.0.

At compile time for the net6.0,

Unified primary reference "System.Reflection.DispatchProxy, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a".
             Using this version instead of original version "4.0.4.0" in " dependencies\System.Private.ServiceModel.dll" because AutoUnify is 'true'.
             Resolved file path is "C:\Program Files\dotnet\packs\Microsoft.NETCore.App.Ref\6.0.8\ref\net6.0\System.Reflection.DispatchProxy.dll".
             Reference found at search path location "{RawFileName}".
             This reference is not "CopyLocal" because at least one source item had "Private" set to "false" and no source items had "Private" set to "true".

Copying file from "Dependencies\System.Private.ServiceModel.dll" to "\bin\Release\net6.0\System.Private.ServiceModel.dll".

The same in a working build:

Unified primary reference "System.Reflection.DispatchProxy, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a".
             Using this version instead of original version "4.0.6.0" in "\Dependencies\net6.0\System.Private.ServiceModel.dll" because AutoUnify is 'true'.
             Resolved file path is "C:\Program Files\dotnet\packs\Microsoft.NETCore.App.Ref\6.0.8\ref\net6.0\System.Reflection.DispatchProxy.dll".
             Reference found at search path location "{RawFileName}".
             This reference is not "CopyLocal" because at least one source item had "Private" set to "false" and no source items had "Private" set to "true".

Copying file from "Dependencies\net6.0\System.Private.ServiceModel.dll" to "\bin\Release\net6.0\System.Private.ServiceModel.dll".

Question is without any changes to the project or in build server, why the dependency has been changed for the net6.0 file?

Twenty
  • 5,234
  • 4
  • 32
  • 67
Bala
  • 223
  • 1
  • 4
  • 16

0 Answers0