I have a bunch of csproj-files for which I want to add a path to search for assembly-references using the AssemblySearchPaths
. As they are many project-files I wanted to do this only once for all using a Dirtector.Build.Props
in the parent-directory of all my projects.
This is my Directory.Build.props
:
<Project>
<Choose>
<When Condition="$(JenkinsBuild)== 'true'">
<PropertyGroup>
<AssemblySearchPaths>
C:\lib; $(AssemblySearchPaths)
</AssemblySearchPaths>
</PropertyGroup>
</When>
</Choose>
</Project>
When I compile my solution using MSBuild
, no reference can be found, not even those from System
.
From MSDN I got this:
Directory.Build.props is imported very early in Microsoft.Common.props, and properties defined later are unavailable to it. So, avoid referring to properties that are not yet defined (and will evaluate to empty).
So I assume AssemblySearchPaths
is just undefined the time the Directory.Builds.props
is invoked.
Is there any other opportunity to add a path to the list of paths to search for assemblies for many projects?