msbuild-propertygroup

Msbuild copy to several locations based on list of destination parameter?

I got a directory I want to copy to a number of locations. Say I have home.aspx I want to copy it to abc/home.aspx def/home.aspx ghi/home.aspx so two questions for me: How do I define the list abc, def, ghi? How do I execute my Copy task with each element of this list? ...

Passing property group value from one MsBuild task to another

How do I keep values defined in one build target alive in other targert? If PropertyGroup is not the write MsBuild entity I should use here, what is? ReleaseDir is printed ok in "Package" target, but is empty in "DoPackage" <Target Name="Package"> <PropertyGroup> <ReleasesDir>c:\tmp</ReleasesDirBase> </PropertyGroup> <Message ...

How to define TeamBuild Item Collection with built executables and libraries

After a TeamBuild project built all files, how can I create a collection of all built .exe and .dll files? For instance, I update all AssemblyInfo versions by creating a property and an itemgroup like so: <PropertyGroup> <AssemblyInfoSpec>AssemblyInfo.*</AssemblyInfoSpec> </PropertyGroup> <Target Name="AfterGet" Condition="'$(IsDesk...

How to specify CodeAnalysisRules in MSBuild via commandline

I want to be able to specify the Code AnalysisRules in commandline MSBuild (for Code Analysis / FXCOP). The project file would have something like this in it: <CodeAnalysisRules>-Microsoft.Globalization#CA1301;-Microsoft.Globalization#CA1302</CodeAnalysisRules> So I would assume that I use something like this: MSBuild.exe /property:Ru...

MSBuild: how to control the parsing of a semicolon delimited property

When a single property contains semicolons, MSBuild automatically parse the property into a list of properties when used within an itemgroup. Here's a snippet from my project: <PropertyGroup> <ConnectionString>workstation id=.;packet size=4096;Integrated Security=SSPI;data source=.;initial catalog=$(SqlDbName)</ConnectionString> </...

MSBuild: asterisks and strange ItemGroup Exclude behaviour

I have a script that attempts to construct an ItemGroup out of all files in a certain directory while excluding files with certain names (regardless of extension). The list of files to be excluded initially contains file extensions, and I am using Community Tasks' RegexReplace to replace the extensions with an asterisk. I then use this ...

MSBuild: how to create a global property?

When running MSBuild, anything passed in on the command line using /p:MyProp=value is accessible from every MSBuild script invoked (via the MSBuild task) from the main script. How can I define a property that is similarly accessible from every script, in a task? For example: Script1.proj: [...] <Target Name="Test"> <MSBuild Projects=...

How to add a custom Property as a child of a PropertyGroup in MSBuild?

I have the following build script, which I run with MSBuild: <?xml version="1.0" encoding="utf-8"?> <Project DefaultTargets="Compile" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion ="3.5"> <PropertyGroup> <BuildDir Condition=" '$(BuildDir)'==' ' ">$(BaseDir)/build</BuildDir> <ProdDir >$(BuildDir)/prod</...

Is there a possibility to use one property value inside another?

Hi, I would like to do something like this: <PropertyGroup> <propone>value</propone> </PropertyGroup> <PropertyGroup> <proptwo>$(propone)</proptwo> </PropertyGroup> Pass one property value as another. Is there a way to do this? How? ...

Find out the "Bit"ness of the current OS in MSBuild

I have a build script that needs to hard code a path to an executable. The path is: C:\Program Files\Microsoft Visual Studio 9.0\SmartDevices\SDK\SDKTools\cabwiz.exe This has worked fine, but now I am running on a 64 bit OS (but my coworker and build server are on 32 bit still). I need the path to be this for me: C:\Program Files...

Scope and order of evaluation of Items in MsBuild

I wonder why in the following code, MsBuild refuses to set the Suffix Metadata. It does work with a CreateItem task instead of the ItemGroup Declaration (because CreateItem is computed at build time) but I can't do this here because this code is in a "property file" : the project has no target, it's just a bunch of properties/items I inc...