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
5
votes
1 answer

Using WriteCodeFragment MSBuild Task

I am trying to use the WriteCodeFragment MSBuild task to create an AssemblyVersion attribute. I'm having a problem creating a property group to correctly pass the ITaskItem array required for processing. Can someone help with an example?
5
votes
2 answers

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…
4
votes
2 answers

Adding a Postbuild event to a project

When I generate a C# project (csproj file) and then compile it, msbuild somehow doesn’t recognize the variables $(ConfigurationName) and $(ProjectDir) (and others) in the pre- and postbuild event. When I Manually move the pre- and postbuild event…
Alfons
  • 511
  • 4
  • 17
4
votes
1 answer

how to pass variable number of items in PropertyGroup/ItemGroup to msbuild script

Please read till I state my question clearly. I'm trying to implement a custom msbuild task that will accept a variable number of input parameters from a msbuild script. I am aware of arrays of input parameters in customs tasks public ITaskItem[]…
Hamza Ahmed
  • 1,571
  • 4
  • 18
  • 35
3
votes
2 answers

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

MSBuild multiple outputpath

I saw this S.O question and have a similar requirement. This is what I have in a .targets file -
Pete
  • 169
  • 2
  • 14
2
votes
1 answer

msbuild properties initialized from functions cannot be converted to items?

I am trying to create an msbuild project where dependency information is read from a text file. I have a text file named project.dep which contains a semicolon separated list of project names. In this example the file contains a;b;c;d I expected the…
samwise
  • 347
  • 1
  • 4
  • 15
2
votes
2 answers

MSBuild item can't be used in MSBuild task, error MSB4012

I have the following MSBuild project file:
Dmitrii Lobanov
  • 4,897
  • 1
  • 33
  • 50
2
votes
1 answer

Define a conditional constant for all builds in Visual Studio

I have a project with some code. I want to determine is RyuJIT is used and if so then write RyuJIT otherwise LegacyJIT. I write: #if RuyJIT Console.WriteLine("RyuJIT"); #else Console.WriteLine("LegacyJIT"); #endif then I'm…
2
votes
1 answer

Changes to csproj not taking effect

In an attempt to make my references update based on my configuration, I've tweaked my .csproj file by adding a property and changing all the references to use it as follows:
Scott Mermelstein
  • 15,174
  • 4
  • 48
  • 76
2
votes
1 answer

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:
WaltiD
  • 1,932
  • 2
  • 23
  • 25
2
votes
2 answers

msbuild, overwriting property value in different file

I am trying to modify property value depending on certain condition in another file. For ex. I have one file that calls target file. Boy
in His Steps
  • 3,075
  • 6
  • 30
  • 38
2
votes
1 answer

Why is $([System.Text.RegularExpressions.Regex]::IsMatch()) evaluated once in ItemGroupDefinition?

So fiddling with MSBuild tasks, and I am finding that a Regex metadata property is evaluated once rather than per item. For example