Questions tagged [msbuild-propertygroup]

Inside a Microsoft Build project, PropertyGroup contains a set of user-defined Item elements.

Inside a Microsoft Build project, PropertyGroup contains a set of user-defined Item elements.

More information:

56 questions
51
votes
8 answers

how to replace string in file using msbuild?

I want to replace a string such "how r u" in file test.xml with a string "i am fine" in another file xy.xml.using regular expression in ms build. ie i have to read string from one file(xy.xml) and replace it in another file test.xml. so please…
31
votes
1 answer

test if an MSBuild property is defined?

In MsBuild, is it possible to create an MSBuild condition (or another situation) that will evaluate whether a Property is 'defined' (presuming that this is previous to assigning the property a value somewhere)? The following seems a little too…
Stato Machino
  • 1,120
  • 3
  • 13
  • 22
22
votes
2 answers

MSBuild Property Scope

Once again I'm battling MSBuild. I want to have a property value defined with a root path. As part of the build, the path will get updated with version information. However, MSBuild seems to have its own scoping rules that seem completely…
dprice
  • 1,089
  • 2
  • 13
  • 19
14
votes
3 answers

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"
ripper234
  • 222,824
  • 274
  • 634
  • 905
14
votes
4 answers

Using Microsoft.Build.Evaluation to publish a database project (.sqlproj)

I need to be able to publish an SSDT project programmatically. I am looking at using Microsoft.Build to do so but can not find any documentation. It seems pretty simple to create the .dacpac, but how would I either publish to an existing database or…
13
votes
2 answers

When you import another msbuild file, what is the order of evaluation?

I have a shared properties file shared.properties.proj $(MSBuildProjectDirectory)\..\Shared Assemblies
Maslow
  • 18,464
  • 20
  • 106
  • 193
13
votes
1 answer

MSBuild project won't load if Import fails?

I created a build target in a project file (App.Tests.csproj) that imports a project: These tasks only exist on our build server, that location does not exist on our developers work station. The build…
detroitpro
  • 3,853
  • 4
  • 35
  • 64
9
votes
3 answers

Is "AutoParameterizationWebConfigConnectionStrings"-option the only way to prevent connection string tokenization?

I am still trying to get my head around MSBuild things. Currently I am fiddling around with deploying via powershell script using the generated scripts from the PackageWeb-Nuget-Package (video demo). I have been trying that out for a few days now…
DrCopyPaste
  • 4,023
  • 1
  • 22
  • 57
8
votes
3 answers

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: workstation id=.;packet…
KMoraz
  • 14,004
  • 3
  • 49
  • 82
7
votes
4 answers

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…
Boris Callens
  • 90,659
  • 85
  • 207
  • 305
7
votes
2 answers

How to create a new property in MSBuild and reference it in WIX

We need to create a property to indicate our software version. Then we want to use it inside our WIX project, i.e., reference it in wxs file. We don't want to define it in wxs file because we want the MSBuild to rename output file based on this…
tete
  • 4,859
  • 11
  • 50
  • 81
6
votes
4 answers

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…
Vaccano
  • 78,325
  • 149
  • 468
  • 850
6
votes
1 answer

MSBuild how to pass a parameter to set a property value?

Assume I have 3 cs projects in a solution and I import this Common.props file in all 3 csproj files. Here is my Common.props file that will sit at the solution level, each project in my solution will import this Common.props file, I am trying to…
OutOFTouch
  • 1,017
  • 3
  • 13
  • 30
6
votes
2 answers

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…
Roman Starkov
  • 59,298
  • 38
  • 251
  • 324
6
votes
3 answers

MSbuild, How to access project property value in Inline Task code?

I have inline Task code written in csharp I wonder if there is anyway to access propect property in inline Task code For ex. I am trying to replace string match with project property value. is it possible?
in His Steps
  • 3,075
  • 6
  • 30
  • 38
1
2 3 4