Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MSBuild project won't load if Import fails?

I created a build target in a project file (App.Tests.csproj) that imports a project:

 <Import Project ="$(Location)\Special.Tasks"/>

These tasks only exist on our build server, that location does not exist on our developers work station. The build target will ever only be run from the build server.

My problem is that when I try to open the sln (containing the project with the build target) on a workstation without the Special.Tasks the project won't load.

I don't want to distribute the Special.Tasks to each workstation.

Is there any way to tell MSBuild or Visual Studio to load even if an import fails?

like image 490
detroitpro Avatar asked Mar 02 '11 16:03

detroitpro


1 Answers

Just add condition to the Import target

<Import Project ="$(Location)\Special.Tasks"
        Condition="Exists('$(Location)\Special.Tasks')"/>
like image 64
Sergio Rykov Avatar answered Oct 30 '22 20:10

Sergio Rykov