samhowes / rules_msbuild

Build .csproj files with Bazel
Apache License 2.0
6 stars 3 forks source link

IDE Doesn't like reference to external project for runfiles reference #175

Closed samhowes closed 2 years ago

samhowes commented 2 years ago

When using rules_msbuild from an external workspace, Project Rider doesn't appear to properly index the Runfiles project when referenced with the built in method

  <ItemGroup>
    <ProjectReference Include="$(BazelExternal)\rules_msbuild\dotnet\tools\Runfiles\Runfiles.csproj" />
  </ItemGroup>

bazel build works just fine

For the using statement:

using RulesMSBuild.Tools.Bazel;

(on MacOS) If I include the project file in the solution via its symlink, Rider will acknowledge the project file, but on import of the project file via alt-enter, it adds the following reference:

<ProjectReference Include="..\..\..\..\..\..\..\private\var\tmp\_bazel_samh\41a27abd535b2c81e130809be7d76b75\external\rules_msbuild\dotnet\tools\Runfiles\Runfiles.csproj" />

Project Rider doesn't recognize that the namespace exists, won't do code completion, and highlights the using statement in red.

Potential solutions:

  1. Publish Runfiles.csproj as a nuget package
  2. Build Runfiles.csproj as a nuget package locally use it as a local nuget source