I have a msbuild script: Msi.msbuild which imports a Variables.msbuild project:
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="CreateInstaller">
<Import Project="$(RedistDir)\Framework\Variables.msbuild" />
<Project>
The Msi.msbuild is build multiple time in another msbuild script: BuildMsi.msbuild
<Target Name="CreateEnvironmentSpecificInstaller" DependsOnTargets="$(SpecificBuildSteps)">
<Message Text="Write installer to $(OutputDir)" />
<MSBuild Projects="$(RedistDir)\Framework\Msi.msbuild" Targets="CreateBatchScripts" StopOnFirstFailure="true" Properties="Configuration=$(Configuration);" RebaseOutputs="true" />
</Target>
The target CreateEnvironmentSpecificInstaller is called several time, each time the content of Variables.msbuild is changed.
But I see that only the first values of Properties in Variable are used for all running time, seems that it is not imported anymore rather than the first one.
Please tell me how can I force the Variables to be re-imported?
Thanks wkl for the answer, base on the idea in that post, I try to rename the Variables file and import those ones, so that the caching is prevented.