Is there a workaround for conditional imports in MSBuild?
I found evidence here and here is the detailed error information in the MSBuild IDE interface. In particular, statements are Importnot reloaded upon creation:
This is a known limitation. VS will process tags only once when the project is loaded. So any tag is active at the time of loading the project (based on any values that you had at the moment) ... what is the tag that you get for the life of this project in the IDE
For example, I might need to import a project, baror bazbased on a value foo:
<Import Project="bar.targets" Condition="'$(foo)' == 'bar'" />
<Import Project="baz.targets" Condition="'$(foo)' == 'baz'" />
Is there a workaround or other approach that I can use to perform the desired functions?
source
share