Questions tagged [msbuild-task]

MSBuild tasks give the MSBuild platform the ability to execute any number of actions during the build process. A task is a unit of executable code used by MSBuild to perform atomic build operations.

MSBuild tasks give the MSBuild platform the ability to execute any number of actions during the build process. A task is a unit of executable code used by MSBuild to perform atomic build operations.

741 questions
90
votes
4 answers

How get exec task output with msbuild

I'm trying to get simple output by exec task with msbuild:
tbicr
  • 24,790
  • 12
  • 81
  • 106
86
votes
8 answers

MSBuild Task syntax for deleting files

I'm trying to write a MSBuild Task that deletes the Obj directory and PDBs from my bin folder on my production build scripts and can't seem to get it to work right. Does anyone have an example where they do this or similar, or a link to a simple…
Chris Marisic
  • 32,487
  • 24
  • 164
  • 258
59
votes
1 answer

What is the difference between a PreBuildEvent, BeforeBuild target and BeforeCompile target in MSBuild?

I recently had to move some code from a PreBuildEvent in Visual Studio into the BeforeBuild target to make it work on AppHarbor. While doing so, I also noticed a BeforeCompile target. What is the difference between these three seemingly similar…
Danny Tuppeny
  • 40,147
  • 24
  • 151
  • 275
53
votes
3 answers

Is there any MSbuild task to check if a string contains another string (similar to string.contains)

I have this Msbuild code: But I was wondering if is there anything similar to check if an string contains…
Oscar Foley
  • 6,817
  • 8
  • 57
  • 90
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…
36
votes
1 answer

Return output from an MsBuild task?

I'd like to calculate a path in a MsBuild task, to be used by another MsBuild task. What is the best way to accomplish this? Setting a environment variable, printing to Console, ...?
ripper234
  • 222,824
  • 274
  • 634
  • 905
34
votes
1 answer

MSBuild builds defaults to debug configuration

I am trying to use MSBuild release mode, but it always defaults to debug. Any idea why? msbuild LP.sln /p:buildmode=release I checked through the following posts; MSBuild task - Build fails because one solution being built in release instead of…
Night Walker
  • 20,638
  • 52
  • 151
  • 228
30
votes
15 answers

MSBuild error MSB3021: Unable to copy file. Could not find file 'obj\Release\myWebProject1.dll'

When using TeamCity to compile my MSBuild XML task script, it fails with this: [10:43:03]: myWebProject1\ myWebProject 1 .csproj (3s) [10:43:07]: [ myWebProject1\ myWebProject1 .csproj] _CopyWebApplicationLegacy [10:43:07]:…
D3vtr0n
  • 2,774
  • 3
  • 33
  • 53
29
votes
6 answers

Unit test MSBuild Custom Task without "Task attempted to log before it was initialized" error

I have written a few MSBuild custom tasks that work well and are use in our CruiseControl.NET build process. I am modifying one, and wish to unit test it by calling the Task's Execute() method. However, if it encounters a line containing…
David White
  • 3,014
  • 1
  • 32
  • 35
28
votes
3 answers

Is a separate Visual Studio license required for a build machine?

I know that some companies allow you to install their products on build machines as required without requiring a separate license (DevExpress is one that comes to mind). However I was wondering if Microsoft had the same allowances on…
benPearce
  • 37,735
  • 14
  • 62
  • 96
28
votes
3 answers

Visual Studio 2008 locks custom MSBuild Task assemblies

I'm developing a custom MSBuild task that builds an ORM layer, and using it in a project. I'm being hampered by Visual Studio's behaviour of holding onto MSBuild task DLLs and not letting go. I'd like to organize my solution like this; My Solution …
Steve Cooper
  • 20,542
  • 15
  • 71
  • 88
25
votes
3 answers

Using MSBuild to Build Multiple Configurations

I'm trying to edit my project file to enable me to have a project that builds multiple build configs at once. I've done this using a batching approach and using the MSBuild task (see below). If I run the script, I get an this error: Error 103 The…
p.q
  • 355
  • 1
  • 3
  • 5
25
votes
5 answers

How to change Assembly Version Number using AssemblyInfoTask?

I am trying to automate the process for setting the Version for all DLL's, after spending some time I came to know the AssemblyInfo Task with which it can most likely be achieved. So I went ahead and installed it, specifically version…
Chetan
  • 642
  • 1
  • 12
  • 31
25
votes
4 answers

Make Jenkins aware of custom NuGet Package Source

I've got a little issue regarding Jenkins and NuGet package restore. What I'm trying to do is build solutions on jenkins (which works perfectly fine). I have enabled package restore for the solution, which generates the .nuget-folder containing…
nozzleman
  • 9,529
  • 4
  • 37
  • 58
24
votes
2 answers

Order of AfterBuild tasks in Visual Studio projects ...?

I have defined several AfterBuild - Tasks in my Visual Studio project with different conditions:
Konrad
  • 4,329
  • 10
  • 54
  • 88
1
2 3
49 50