Is it possible to transfer properties between MSBuild projects?

Is it possible to transfer a property from one msbuild project to another? Thus, in a single .proj file there is a property with PropertyName = "Foo" (for example). Can we access this from another .proj file, that is, use "$ (Foo)" in another msbuild project?

+4
source share
3 answers

One way to do this is to pass properties when you call the following script, for example

<MSBuild Projects="another.proj" Properties="PropertyName=$(Foo)" /> 
+4
source

Using the import element in the file in which you want to use the property.

 <Import Project="ProjectPath"/> 
+4
source

Try using the $ (MSBuildArguments) variable. I know that it works in TFS, but I'm not sure if it works on the command line.

0
source

All Articles