I am trying to add a link to a project and a file in the same dll in csproj with the BuildingInVsideisualStudio property. But when they are in csproj together, only the file link is selected. If I delete the link to the file, it will take csproj. I tried replacing the order, but no luck. Any ideas why this is not working?
Here is the basic idea:
<ItemGroup Condition="'$(BuildingInsideVisualStudio)' == false">
<Reference Include="MyNamespace.Mine">
<HintPath>..\$(OutDir)\MyNamespace.Mine.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup Condition="'$(BuildingInsideVisualStudio)' == '' Or '$(BuildingInsideVisualStudio)' == true">
<ProjectReference Include="..\MyNamespace.Mine.csproj">
<Project>{GUID}</Project>
<Name>MyNamespace.Mine</Name>
</ProjectReference>
</ItemGroup>
Someone else has taken this path, but there seem to be some reservations . I need to do this conditionally due to my build process, which cannot change. Using a file link makes me lose Go to Definition and Find All References (sorry, but I cannot install ReSharper to solve this problem).