Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
rainersigwald opened this issue Sep 24, 2019 · 1 comment
Open
Labels
Area: Debuggability Issues impacting the diagnosability of builds, including logging and clearer error messages. Task: Resolve Assembly References (RAR) triaged

Comments

@rainersigwald
Copy link
Member

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
Copy link
Member Author

rainersigwald commented Apr 21, 2023

Spamming a few keywords in here:

  • reference can be unified to a higher version
  • one of the dlls it lists wants the higher version, but the log messages don't say which one it is
  • MSB3277

rainersigwald added a commit to rainersigwald/msbuild that referenced this issue Sep 18, 2023
Consider a message like

```
warning MSB3277: Found conflicts between different versions of "System.Runtime.InteropServices.RuntimeInformation" that could not be resolved.
    There was a conflict between "System.Runtime.InteropServices.RuntimeInformation, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" and "System.Runtime.InteropServices.RuntimeInformation, Version=4.0.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a".
    "System.Runtime.InteropServices.RuntimeInformation, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" was chosen because it was primary and "System.Runtime.InteropServices.RuntimeInformation, Version=4.0.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" was not.
    References which depend on "System.Runtime.InteropServices.RuntimeInformation, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" [C:\VisualStudio\VS17PrevPublic\Common7\IDE\PublicAssemblies\System.Runtime.InteropServices.RuntimeInformation.dll].
        C:\VisualStudio\VS17PrevPublic\Common7\IDE\PublicAssemblies\System.Runtime.InteropServices.RuntimeInformation.dll
            Project file item includes which caused reference "C:\VisualStudio\VS17PrevPublic\Common7\IDE\PublicAssemblies\System.Runtime.InteropServices.RuntimeInformation.dll".
                System.Runtime.InteropServices.RuntimeInformation
    References which depend on "System.Runtime.InteropServices.RuntimeInformation, Version=4.0.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" [].
        C:\Users\user\.nuget\packages\azure.core\1.25.0\lib\net461\Azure.Core.dll
            Project file item includes which caused reference "C:\Users\user\.nuget\packages\azure.core\1.25.0\lib\net461\Azure.Core.dll".
                C:\Users\user\.nuget\packages\azure.core\1.25.0\lib\net461\Azure.Core.dll
                C:\Users\user\.nuget\packages\azure.identity\1.8.0\lib\netstandard2.0\Azure.Identity.dll
                C:\Users\user\.nuget\packages\azure.security.keyvault.secrets\4.4.0\lib\netstandard2.0\Azure.Security.KeyVault.Secrets.dll
                C:\Users\user\.nuget\packages\nuget.services.keyvault\2.111.0\lib\net472\NuGet.Services.KeyVault.dll
                C:\Users\user\.nuget\packages\nuget.services.configuration\2.111.0\lib\net472\NuGet.Services.Configuration.dll
```

What the message _means_ is that the first reference is the winner, and
what was chosen there will require unification for all the other
assemblies listed in the second part of the message. But what it says is
that the list of assemblies in the second part of the message depend on
the second version, which is not necessarily true--in fact, that's the
list of  references that _can be unified_ to that version.

This isn't a full fix for dotnet#4757 but hopefully makes the message a bit
less misleading.
JaynieBai pushed a commit that referenced this issue Oct 10, 2023
* Mention unification in RAR found-conflicts message

Consider a message like

```
warning MSB3277: Found conflicts between different versions of "System.Runtime.InteropServices.RuntimeInformation" that could not be resolved.
    There was a conflict between "System.Runtime.InteropServices.RuntimeInformation, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" and "System.Runtime.InteropServices.RuntimeInformation, Version=4.0.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a".
    "System.Runtime.InteropServices.RuntimeInformation, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" was chosen because it was primary and "System.Runtime.InteropServices.RuntimeInformation, Version=4.0.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" was not.
    References which depend on "System.Runtime.InteropServices.RuntimeInformation, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" [C:\VisualStudio\VS17PrevPublic\Common7\IDE\PublicAssemblies\System.Runtime.InteropServices.RuntimeInformation.dll].
        C:\VisualStudio\VS17PrevPublic\Common7\IDE\PublicAssemblies\System.Runtime.InteropServices.RuntimeInformation.dll
            Project file item includes which caused reference "C:\VisualStudio\VS17PrevPublic\Common7\IDE\PublicAssemblies\System.Runtime.InteropServices.RuntimeInformation.dll".
                System.Runtime.InteropServices.RuntimeInformation
    References which depend on "System.Runtime.InteropServices.RuntimeInformation, Version=4.0.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" [].
        C:\Users\user\.nuget\packages\azure.core\1.25.0\lib\net461\Azure.Core.dll
            Project file item includes which caused reference "C:\Users\user\.nuget\packages\azure.core\1.25.0\lib\net461\Azure.Core.dll".
                C:\Users\user\.nuget\packages\azure.core\1.25.0\lib\net461\Azure.Core.dll
                C:\Users\user\.nuget\packages\azure.identity\1.8.0\lib\netstandard2.0\Azure.Identity.dll
                C:\Users\user\.nuget\packages\azure.security.keyvault.secrets\4.4.0\lib\netstandard2.0\Azure.Security.KeyVault.Secrets.dll
                C:\Users\user\.nuget\packages\nuget.services.keyvault\2.111.0\lib\net472\NuGet.Services.KeyVault.dll
                C:\Users\user\.nuget\packages\nuget.services.configuration\2.111.0\lib\net472\NuGet.Services.Configuration.dll
```

What the message _means_ is that the first reference is the winner, and
what was chosen there will require unification for all the other
assemblies listed in the second part of the message. But what it says is
that the list of assemblies in the second part of the message depend on
the second version, which is not necessarily true--in fact, that's the
list of  references that _can be unified_ to that version.

This isn't a full fix for #4757 but hopefully makes the message a bit
less misleading.

* Update tests

* fixup! Update tests
bulatgrzegorz pushed a commit to bulatgrzegorz/selective-condition-evaluator that referenced this issue Oct 16, 2023
* Mention unification in RAR found-conflicts message

Consider a message like

```
warning MSB3277: Found conflicts between different versions of "System.Runtime.InteropServices.RuntimeInformation" that could not be resolved.
    There was a conflict between "System.Runtime.InteropServices.RuntimeInformation, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" and "System.Runtime.InteropServices.RuntimeInformation, Version=4.0.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a".
    "System.Runtime.InteropServices.RuntimeInformation, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" was chosen because it was primary and "System.Runtime.InteropServices.RuntimeInformation, Version=4.0.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" was not.
    References which depend on "System.Runtime.InteropServices.RuntimeInformation, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" [C:\VisualStudio\VS17PrevPublic\Common7\IDE\PublicAssemblies\System.Runtime.InteropServices.RuntimeInformation.dll].
        C:\VisualStudio\VS17PrevPublic\Common7\IDE\PublicAssemblies\System.Runtime.InteropServices.RuntimeInformation.dll
            Project file item includes which caused reference "C:\VisualStudio\VS17PrevPublic\Common7\IDE\PublicAssemblies\System.Runtime.InteropServices.RuntimeInformation.dll".
                System.Runtime.InteropServices.RuntimeInformation
    References which depend on "System.Runtime.InteropServices.RuntimeInformation, Version=4.0.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" [].
        C:\Users\user\.nuget\packages\azure.core\1.25.0\lib\net461\Azure.Core.dll
            Project file item includes which caused reference "C:\Users\user\.nuget\packages\azure.core\1.25.0\lib\net461\Azure.Core.dll".
                C:\Users\user\.nuget\packages\azure.core\1.25.0\lib\net461\Azure.Core.dll
                C:\Users\user\.nuget\packages\azure.identity\1.8.0\lib\netstandard2.0\Azure.Identity.dll
                C:\Users\user\.nuget\packages\azure.security.keyvault.secrets\4.4.0\lib\netstandard2.0\Azure.Security.KeyVault.Secrets.dll
                C:\Users\user\.nuget\packages\nuget.services.keyvault\2.111.0\lib\net472\NuGet.Services.KeyVault.dll
                C:\Users\user\.nuget\packages\nuget.services.configuration\2.111.0\lib\net472\NuGet.Services.Configuration.dll
```

What the message _means_ is that the first reference is the winner, and
what was chosen there will require unification for all the other
assemblies listed in the second part of the message. But what it says is
that the list of assemblies in the second part of the message depend on
the second version, which is not necessarily true--in fact, that's the
list of  references that _can be unified_ to that version.

This isn't a full fix for dotnet#4757 but hopefully makes the message a bit
less misleading.

* Update tests

* fixup! Update tests
MichalPavlik pushed a commit that referenced this issue Oct 17, 2023
* Mention unification in RAR found-conflicts message

Consider a message like

```
warning MSB3277: Found conflicts between different versions of "System.Runtime.InteropServices.RuntimeInformation" that could not be resolved.
    There was a conflict between "System.Runtime.InteropServices.RuntimeInformation, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" and "System.Runtime.InteropServices.RuntimeInformation, Version=4.0.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a".
    "System.Runtime.InteropServices.RuntimeInformation, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" was chosen because it was primary and "System.Runtime.InteropServices.RuntimeInformation, Version=4.0.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" was not.
    References which depend on "System.Runtime.InteropServices.RuntimeInformation, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" [C:\VisualStudio\VS17PrevPublic\Common7\IDE\PublicAssemblies\System.Runtime.InteropServices.RuntimeInformation.dll].
        C:\VisualStudio\VS17PrevPublic\Common7\IDE\PublicAssemblies\System.Runtime.InteropServices.RuntimeInformation.dll
            Project file item includes which caused reference "C:\VisualStudio\VS17PrevPublic\Common7\IDE\PublicAssemblies\System.Runtime.InteropServices.RuntimeInformation.dll".
                System.Runtime.InteropServices.RuntimeInformation
    References which depend on "System.Runtime.InteropServices.RuntimeInformation, Version=4.0.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" [].
        C:\Users\user\.nuget\packages\azure.core\1.25.0\lib\net461\Azure.Core.dll
            Project file item includes which caused reference "C:\Users\user\.nuget\packages\azure.core\1.25.0\lib\net461\Azure.Core.dll".
                C:\Users\user\.nuget\packages\azure.core\1.25.0\lib\net461\Azure.Core.dll
                C:\Users\user\.nuget\packages\azure.identity\1.8.0\lib\netstandard2.0\Azure.Identity.dll
                C:\Users\user\.nuget\packages\azure.security.keyvault.secrets\4.4.0\lib\netstandard2.0\Azure.Security.KeyVault.Secrets.dll
                C:\Users\user\.nuget\packages\nuget.services.keyvault\2.111.0\lib\net472\NuGet.Services.KeyVault.dll
                C:\Users\user\.nuget\packages\nuget.services.configuration\2.111.0\lib\net472\NuGet.Services.Configuration.dll
```

What the message _means_ is that the first reference is the winner, and
what was chosen there will require unification for all the other
assemblies listed in the second part of the message. But what it says is
that the list of assemblies in the second part of the message depend on
the second version, which is not necessarily true--in fact, that's the
list of  references that _can be unified_ to that version.

This isn't a full fix for #4757 but hopefully makes the message a bit
less misleading.

* Update tests

* fixup! Update tests
@AR-May AR-May added the triaged label Feb 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Debuggability Issues impacting the diagnosability of builds, including logging and clearer error messages. Task: Resolve Assembly References (RAR) triaged
Projects
None yet
Development

No branches or pull requests

2 participants