Itβs inconvenient to do this correctly based on how Microsoft.WebApplications.targets defines the _CopyWebApplication target and how Microsoft.Common.targets handles the OutDir and OutputPath .
If you want to change this in the project file, you need to:
- Declare the
WebProjectOutputDir property after importing into Microsoft.WebApplications.targets - Declare the
OutDir property before importing into Microsoft.WebApplications.targets
There are several reasons why you should do this.
Microsoft.WebApplications.targets override any WebProjectOutputDir declaration if it is declared before the import statement. Therefore, he must come after.
Also inside Microsoft.WebApplications.targets _CopyWebApplication is defined as follows:
<Target Name="_CopyWebApplication" Condition="'$(OutDir)' != '$(OutputPath)'" > .... </Target>
Looking at the condition, you will see that the goal will not be fulfilled if OutDir and OutputPath are the same value. You cannot just change the OutputPath, because the OutDir based on the OutputPath , so you need to change the OutDir and make sure it is before importing into this file, because other properties are built on the basis of this property.
Less than ideal, but hopefully this helps you.
Sayed Ibrahim Hashimi
source share