dotnet / msbuild

The Microsoft Build Engine (MSBuild) is the build platform for .NET and Visual Studio.
https://docs.microsoft.com/visualstudio/msbuild/msbuild
MIT License
5.23k stars 1.35k forks source link

RAR conflict logging logs post-binding-redirect assembly versions #4757

Open rainersigwald opened 5 years ago

rainersigwald commented 5 years ago

ResolveAssemblyReferences logs information about what references were involved in the leadup to a conflict

  There was a conflict between "StreamJsonRpc, Version=2.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" and "StreamJsonRpc, Version=2.2.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a". (TaskId:25)
      "StreamJsonRpc, Version=2.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" was chosen because it was primary and "StreamJsonRpc, Version=2.2.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" was not. (TaskId:25)
      References which depend on "StreamJsonRpc, Version=2.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" [C:\Users\raines\.nuget\packages\streamjsonrpc\2.1.74\lib\netstandard2.0\StreamJsonRpc.dll]. (TaskId:25)
          C:\Users\raines\.nuget\packages\streamjsonrpc\2.1.74\lib\netstandard2.0\StreamJsonRpc.dll (TaskId:25)
            Project file item includes which caused reference "C:\Users\raines\.nuget\packages\streamjsonrpc\2.1.74\lib\netstandard2.0\StreamJsonRpc.dll". (TaskId:25)
              C:\Users\raines\.nuget\packages\streamjsonrpc\2.1.74\lib\netstandard2.0\StreamJsonRpc.dll (TaskId:25)
      References which depend on "StreamJsonRpc, Version=2.2.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" []. (TaskId:25)
          C:\Users\raines\.nuget\packages\microsoft.servicehub.framework\2.0.72\lib\netstandard2.0\Microsoft.ServiceHub.Framework.dll (TaskId:25)
            Project file item includes which caused reference "C:\Users\raines\.nuget\packages\microsoft.servicehub.framework\2.0.72\lib\netstandard2.0\Microsoft.ServiceHub.Framework.dll". (TaskId:25)
              C:\Users\raines\.nuget\packages\microsoft.servicehub.framework\2.0.72\lib\netstandard2.0\Microsoft.ServiceHub.Framework.dll (TaskId:25)
              C:\Users\raines\.nuget\packages\microsoft.visualstudio.shell.15.0\16.4.29318.21\lib\net472\Microsoft.VisualStudio.Shell.15.0.dll (TaskId:25)
              C:\Users\raines\.nuget\packages\microsoft.visualstudio.languageservices\3.2.0-beta4-19359-03\lib\net472\Microsoft.VisualStudio.LanguageServices.dll (TaskId:25)
              S:\project-system\artifacts\Debug\bin\Dlls\Microsoft.VisualStudio.ProjectSystem.Managed.dll (TaskId:25)
              C:\Users\raines\.nuget\packages\microsoft.visualstudio.projectsystem\16.2.133-pre\lib\net472\Microsoft.VisualStudio.ProjectSystem.VS.dll (TaskId:25)
              C:\Users\raines\.nuget\packages\microsoft.visualstudio.shell.design\16.0.28316-pre\lib\net45\Microsoft.VisualStudio.Shell.Design.dll (TaskId:25)
              C:\Users\raines\.nuget\packages\microsoft.vsdesigner\16.0.28321-alpha\lib\net472\Microsoft.VSDesigner.dll (TaskId:25)
          C:\Users\raines\.nuget\packages\microsoft.visualstudio.language\16.0.428\lib\net472\Microsoft.VisualStudio.Language.dll (TaskId:25)
            Project file item includes which caused reference "C:\Users\raines\.nuget\packages\microsoft.visualstudio.language\16.0.428\lib\net472\Microsoft.VisualStudio.Language.dll". (TaskId:25)
              C:\Users\raines\.nuget\packages\microsoft.visualstudio.language\16.0.428\lib\net472\Microsoft.VisualStudio.Language.dll (TaskId:25)
              C:\Users\raines\.nuget\packages\microsoft.visualstudio.editor\16.0.428\lib\net472\Microsoft.VisualStudio.Editor.dll (TaskId:25)
              C:\Users\raines\.nuget\packages\microsoft.visualstudio.languageservices\3.2.0-beta4-19359-03\lib\net472\Microsoft.VisualStudio.LanguageServices.dll (TaskId:25)
              S:\project-system\artifacts\Debug\bin\Dlls\Microsoft.VisualStudio.ProjectSystem.Managed.dll (TaskId:25)
          C:\Users\raines\.nuget\packages\microsoft.visualstudio.languageservices\3.2.0-beta4-19359-03\lib\net472\Microsoft.VisualStudio.LanguageServices.dll (TaskId:25)
            Project file item includes which caused reference "C:\Users\raines\.nuget\packages\microsoft.visualstudio.languageservices\3.2.0-beta4-19359-03\lib\net472\Microsoft.VisualStudio.LanguageServices.dll". (TaskId:25)
              C:\Users\raines\.nuget\packages\microsoft.visualstudio.languageservices\3.2.0-beta4-19359-03\lib\net472\Microsoft.VisualStudio.LanguageServices.dll (TaskId:25)
              S:\project-system\artifacts\Debug\bin\Dlls\Microsoft.VisualStudio.ProjectSystem.Managed.dll (TaskId:25)
          C:\Users\raines\.nuget\packages\microsoft.visualstudio.utilities\16.4.29317.144\lib\net46\Microsoft.VisualStudio.Utilities.dll (TaskId:25)
            Project file item includes which caused reference "C:\Users\raines\.nuget\packages\microsoft.visualstudio.utilities\16.4.29317.144\lib\net46\Microsoft.VisualStudio.Utilities.dll". (TaskId:25)
              C:\Users\raines\.nuget\packages\microsoft.visualstudio.utilities\16.4.29317.144\lib\net46\Microsoft.VisualStudio.Utilities.dll (TaskId:25)
              C:\Users\raines\.nuget\packages\microsoft.visualstudio.imaging\16.4.29317.144\lib\net472\Microsoft.VisualStudio.Imaging.dll (TaskId:25)
              C:\Users\raines\.nuget\packages\microsoft.visualstudio.languageservices\3.2.0-beta4-19359-03\lib\net472\Microsoft.VisualStudio.LanguageServices.dll (TaskId:25)
              S:\project-system\artifacts\Debug\bin\Dlls\Microsoft.VisualStudio.ProjectSystem.Managed.dll (TaskId:25)
              C:\Users\raines\.nuget\packages\microsoft.visualstudio.shell.15.0\16.4.29318.21\lib\net472\Microsoft.VisualStudio.Shell.15.0.dll (TaskId:25)
              C:\Users\raines\.nuget\packages\microsoft.visualstudio.projectsystem\16.2.133-pre\lib\net472\Microsoft.VisualStudio.ProjectSystem.VS.dll (TaskId:25)
              C:\Users\raines\.nuget\packages\microsoft.visualstudio.shell.design\16.0.28316-pre\lib\net45\Microsoft.VisualStudio.Shell.Design.dll (TaskId:25)
              C:\Users\raines\.nuget\packages\microsoft.visualstudio.shell.framework\16.4.29318.21\lib\net472\Microsoft.VisualStudio.Shell.Framework.dll (TaskId:25)
              C:\Users\raines\.nuget\packages\microsoft.vsdesigner\16.0.28321-alpha\lib\net472\Microsoft.VSDesigner.dll (TaskId:25)
C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(2106,5): warning MSB3277: Found conflicts between different versions of "StreamJsonRpc" that could not be resolved.  These reference conflicts are listed in the build log when log verbosity is set to detailed. [S:\project-system\src\Microsoft.VisualStudio.ProjectSystem.Managed.VS\Microsoft.VisualStudio.ProjectSystem.Managed.VS.csproj]

But that logging is unclear, because most of those assemblies didn't have a reference to version 2.2.0.0 of StreamJsonRpc:

$ ildasm /text C:\Users\raines\.nuget\packages\microsoft.servicehub.framework\2.0.72\lib\netstandard2.0\Microsoft.ServiceHub.Framework.dll | rg -A4 "assembly extern StreamJsonRpc"                                                             .assembly extern StreamJsonRpc
{
  .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A )                         // .?_....:
  .ver 2:1:0:0
}
$ ildasm /text C:\Users\raines\.nuget\packages\microsoft.visualstudio.language\16.0.428\lib\net472\Microsoft.VisualStudio.Language.dll | rg -A4 "assembly extern StreamJsonRpc"                                                                 .assembly extern StreamJsonRpc
{
  .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A )                         // .?_....:
  .ver 1:3:0:0
}
$ ildasm /text C:\Users\raines\.nuget\packages\microsoft.visualstudio.languageservices\3.2.0-beta4-19359-03\lib\net472\Microsoft.VisualStudio.LanguageServices.dll | rg -A4 "assembly extern StreamJsonRpc"                                     .assembly extern StreamJsonRpc
{
  .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A )                         // .?_....:
  .ver 2:0:0:0
}
$ ildasm /text C:\Users\raines\.nuget\packages\microsoft.visualstudio.utilities\16.4.29317.144\lib\net46\Microsoft.VisualStudio.Utilities.dll | rg -A4 "assembly extern StreamJsonRpc"                                                          .assembly extern StreamJsonRpc
{
  .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A )                         // .?_....:
  .ver 2:2:0:0
}            

Instead, they had references that RAR considered unifiable to the 2.2.0.0 version.

To really debug this problem, it would be nice to see the actual versions referenced, plus whether they were unifiable or not. In this case the error is that the direct reference is less than the highest indirect reference. Maybe we could just . . . say that?

rainersigwald commented 1 year ago

Spamming a few keywords in here: