Collectives™ on Stack Overflow
Find centralized, trusted content and collaborate around the technologies you use most.
Learn more about Collectives
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Learn more about Teams
I manually edited in a reference (
Reference
not
ProjectReference
) in my csproj file, and after reviewing the code, I can see that the hintpath is wrong:
+ <Reference Include="Company.Core.Data.Web.UnitTests">
+ <HintPath>..\..\..\..\..\Code\Bin\Company.Core.Data.Web.UnitTests.dll</HintPath>
+ <Private>True</Private>
+ </Reference>
The right path would be ..\..\..\..\..\Build\UnitTests\Company.Core.Data.Web.UnitTests.dll
.
However, I notice that a clean build of my project works fine. Does this matter? Is this something I need to fix?
–
–
As described in https://stackoverflow.com/a/2733113/5749914, Visual Studio will search a number of locations for the DLL, and the fact that a clean build is working with a incorrect hint path indicates the hint path is not needed.
In this case, the $(outDir) was being searched: in my project, the outputPath tag was
<OutputPath>..\..\..\..\..\Build\UnitTests\</OutputPath>.
which was the same directory my project was being built to.
So, if the referenced DLL is in the same build directory that the project is being built to, there is no need for a hintpath.
–
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.