Reputation: 3249
I am trying to specify a custom ReferencePath
in my .csproj file, that uses the new format.
Here's how it looks like:
<PropertyGroup>
<ReferencePath>C:\...\binaries</ReferencePath>
</PropertyGroup>
With the following reference:
<Reference Include="MyDll">
<Private>false</Private>
<SpecificVersion>false</SpecificVersion>
</Reference>
C:\...\binaries
contains MyDll.dll
However, during build I still get
warning MSB3245: Could not resolve this reference. Could not locate the assembly "MyDll". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors.
I am trying to switch to ReferencePath
from HintPath
s, as they've become cumbersome to maintain.
Upvotes: 3
Views: 1665
Reputation: 206
ReferencePath can be added manually to new csproj:
<PropertyGroup>
<AssemblySearchPaths>
$(AssemblySearchPaths);
$(ReferencePath);
</AssemblySearchPaths>
</PropertyGroup>
Upvotes: 0
Reputation: 3107
In the new SDK csproj you can use the AssemblySearchPaths variable instead of the ReferencePath variable to influence assembly probing
<AssemblySearchPaths>
$(YOUR_SEMICOLON_SEPARATED_DIR_PATHS);$(AssemblySearchPaths);
</AssemblySearchPaths>
However, be careful with the old .NET Framework projects where this trick does not work.
Upvotes: 4