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

Annotate RAR SearchPaths added because they're "next to a reference" #9408

Closed
rainersigwald opened this issue Nov 8, 2023 · 0 comments · Fixed by #9700
Closed

Annotate RAR SearchPaths added because they're "next to a reference" #9408

rainersigwald opened this issue Nov 8, 2023 · 0 comments · Fixed by #9700

Comments

@rainersigwald
Copy link
Member

If you have an assembly in a folder next to an explicitly referenced-by-path assembly, and also have a transitive or direct-by-name reference to it, it can be found next to the explicitly referenced-by-path assembly. But the logging only indicates that it was found "for SearchPath", which is confusing because that folder wasn't in RAR's input SearchPath.

For example, build this project from a Developer Command Prompt:

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <TargetFramework>net472</TargetFramework>
  </PropertyGroup>

  <ItemGroup>
    <Reference Include="$(DevEnvDir)\..\..\MSBuild\Current\Bin\Microsoft.Build.dll" />
    <Reference Include="Microsoft.Build.Framework, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
  </ItemGroup>

</Project>

That produces this RAR snippet for Framework:

Primary reference "Microsoft.Build.Framework, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a". (TaskId:59)
    Resolved file path is "C:\Program Files\Microsoft Visual Studio\2022\Preview\MSBuild\Current\Bin\Microsoft.Build.Framework.dll". (TaskId:59)
    Reference found at search path location "C:\Program Files\Microsoft Visual Studio\2022\Preview\MSBuild\Current\Bin". (TaskId:59)
        For SearchPath "C:\Program Files\Microsoft Visual Studio\2022\Preview\MSBuild\Current\Bin". (TaskId:59)
        Considered "C:\Program Files\Microsoft Visual Studio\2022\Preview\MSBuild\Current\Bin\Microsoft.Build.Framework.winmd", but it didn't exist. (TaskId:59)

If the problem you're troubleshooting is "why did this file get resolved here?" there's a lot of confusion looking at that. If it could say something like

-        For SearchPath "C:\Program Files\Microsoft Visual Studio\2022\Preview\MSBuild\Current\Bin". (TaskId:59)
+        For SearchPath "C:\Program Files\Microsoft Visual Studio\2022\Preview\MSBuild\Current\Bin" (added by referencing assembly "Microsoft.Build, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"). (TaskId:59)

it might be clearer (but any improvement would be good).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants