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
9
votes
3 answers

How to get import custom tasks more than once without warning message?

I'm using some custom tasks from MSBuild Extension Pack (MEP). My projects are splitted among many files. In those files I import the MEP tasks using (twice or three times in two/three files). I receive the warning message when doing this…
Nam G VU
  • 33,193
  • 69
  • 233
  • 372
9
votes
1 answer

MSBuild TFS Build Number

I have been using SVN for a little while now. recently on a project I am using TFS. With the builds I like to append/update the build version number on the project output. I do this on the masterpage so that it is clearly visible on the…
minalg
  • 481
  • 2
  • 4
  • 13
9
votes
1 answer

MSBuild ItemGroup with condition

I don't know if ItemGroup is the right type to use. I will get 4 different booleans that will be true or false depending on choice. I would like to fill up an ItemGroup with this "strings" depending on the true or false. Is that possible or what…
9
votes
1 answer

Building a particular revision in Jenkins Pipeline

I am using SVN as my source control repository and Jenkins as my CI tool. I run MSBuild scripts using Jenkins to do the actual builds and deploys. I also use the Jenkins Pipeline plugin to do manage the building of downstream projects. I have an…
Sachin Kainth
  • 45,256
  • 81
  • 201
  • 304
8
votes
3 answers

Honoring exit codes from batch files invoked by msbuild

I have a batch file that is using the exit command to return an exit code. This batch file may, in some cases, be invoked interactively from a commandline, or in other cases, may be run as part of an MSBuild project, using the Exec task. If I use…
Daniel Fortunov
  • 43,309
  • 26
  • 81
  • 106
8
votes
1 answer

The task factory "CodeTaskFactory" is not supported on the .NET Core version of MSBuild

In VS2019, I have MVC dotnet framework project and while doing dotnet build got the issue error MSB4801: The task factory "CodeTaskFactory" is not supported on the .NET Core version of MSBuild error MSB4175: The task factory "CodeTaskFactory" could…
Himan
  • 125
  • 3
  • 12
8
votes
2 answers

How to run MSBuild Target BEFORE compilation but only when compilation will happen

I have a C# library project that hase some dependencies that a created in "BeforeBuild" with PowerShell. MSBuild seems to execute target "BeforeBuild" each time, also if the library project itself does not need to build. I'd like to configure the…
8
votes
3 answers

MSBuild Starter Kits

Just wondering if anyone knows if there are any MSBuild starter kits out there. What I mean by starter kits is that from the looks of it most builds to kinda the same sort of steps with minor changes here and there (i.e. most builds would run test,…
vdh_ant
  • 12,720
  • 13
  • 66
  • 86
8
votes
2 answers

MSBuild Task for setting custom attribute in AssemblyInfo.cs

Is there a MSBuild task for setting custom attribute in AssemblyInfo.cs? I found AssemblyInfo task but it seems that it cannot set custom attributes, only predefined ones. I'd like to set 3 custom properties I have added into this file. Any…
Vajda
  • 1,795
  • 6
  • 39
  • 49
8
votes
1 answer

How do I get an msbuild task to do config transforms on a collection of files?

I am trying to transform all of the web.config files in a project I have, here's a my tree structure: Transform.bat Transforms ConfigTransform.proj Web.Transform.config Website web.config Views web.config There's more web.config files, but…
sebastiaan
  • 5,870
  • 5
  • 38
  • 68
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
1 answer

Pass custom msbuild target from Solution to Project

I have a Solution with a large number of associated .csproj files. Each .csproj file has a .... The build fails when I try to compile the whole solution: > msbuild mysolution.sln /t:PublishQA` "c:\myproj.sln" (publishqa…
Byron Whitlock
  • 52,691
  • 28
  • 123
  • 168
7
votes
2 answers

How make MSBuild build custom target specified in csproj building sln?

I am facing an issue with MSBuild I can't overcome it by myself. As a result I rely on community's wisdom. The real situation I'm having troubles with I have a soluiton file containing several projects with dependencies to other projects in same…
nbulba
  • 645
  • 2
  • 7
  • 17
7
votes
2 answers

How do you integrate ivy with MSbuild

What approach has worked well for you combining IVY + msbuild? Our goal is to integrate IVY into the C#/C++ build process for dependency resolution and publishing. We have tried adding it to custom tasks at the beginning and end of the build and…
Peter Kahn
  • 12,364
  • 20
  • 77
  • 135
7
votes
2 answers

Build fails in Visual Studio App Center for Xamarin iOS: Unsafe code may only appear if compiling with /unsafe

I'm trying to build a Xamarin iOS app in Visual Studio App Center. The solution contains two projects. One is a Xamarin iOS project. The other is a bindings library project. The bindings library project is configured with the Allow 'unsafe' code…
Luca
  • 111
  • 6