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

MS Build copy a list of directories stored in Item

I have a text file which contains some locations of the files which I want to copy to a temp directory ---- List.txt ---- Build\Java Build\Classes Now, I am fetching this list into an Item
Arpit
  • 6,212
  • 8
  • 38
  • 69
6
votes
4 answers

Injecting assembly version numbers at build time

I want to change the assembly version number of a C# project at build time by passing it as a property on the MSBuild command line. AssemblyInfo Task will modify the assembly version inside a AssemblyInfo.cs before compiling. This is nearly what I…
Charles
  • 2,642
  • 3
  • 33
  • 53
6
votes
1 answer

.NET MSBuild Targets AfterTargets=Pack using dotnet build

UPDATE: It seems that adding dotnet build -v d a.k.a setting the verbosity to detailed is revealing more details (obviously) about this process ORIGINAL: Referencing: https://learn.microsoft.com/en-us/nuget/reference/msbuild-targets I'm using dotnet…
Callum Linington
  • 14,213
  • 12
  • 75
  • 154
6
votes
2 answers

Run powershell script during MSBuild

I have a .NET Framework 4.5.2 WebAPI2 project. While building the project in Visual Studio, I want a powershell script I wrote to run before each and every build. If the powershell script exits with any non-zero code, I want the build to fail and…
mckennawebdev
  • 547
  • 1
  • 5
  • 17
6
votes
3 answers

MSBuild - trying to run xUnit (.net) tests

I'm trying to set up a C# project that'll run xUnit tests when I build, so I can use them in continuous integration. I have a regular project, a class library test project using xUnit, and my test runner project. From everything I've read, it…
Ryan Lundy
  • 204,559
  • 37
  • 180
  • 211
6
votes
0 answers

MSBuild fails with an error in the "AL" task with error code AL1019

We are currently having problems while compiling a solution with MSBuild. The build fails randomly on the resource linking step inside the task "AL" which executes the "AL.exe" linker. ALINK : error AL1019: Metadata failure while creating assembly…
hessenmob82
  • 175
  • 12
6
votes
1 answer

MSBuild WriteCodeFragment Task

It's not clear to me what the purpose of the WriteCodeFragment task is (https://msdn.microsoft.com/en-us/library/microsoft.build.tasks.writecodefragment.aspx). Google just seems to turn-up documentation and the one example I've seen isn't…
Dustin Oprea
  • 9,673
  • 13
  • 65
  • 105
6
votes
2 answers

MsBuild does not look in the good directory for custom task's second-level dependencies

I wrote a MsBuild Task : MyTask. In my solution, I have the Task project and others projects. MyTask references a project (say ProjA) which references third assemblies, say (dep1 and dep2). The projects all builds well and I have the outputs in one…
6
votes
1 answer

Moving a file in MSBuild using relative path

I'm trying to move all files of a certain type to a directory relative to the file itself and I'm wondering if it's possible using MSBuild. Basically, I'm using the Microsoft AJAX Minifier to minify all Javascript and CSS files on my site. This…
hackerhasid
  • 11,699
  • 10
  • 42
  • 60
6
votes
1 answer

Files in ItemGroup not detected by AfterBuild Target

What the question should have been: Here is the content of my ModuleCompilation.targets file :
Apollidore
  • 183
  • 8
6
votes
2 answers

Using MSBuild, how to construct a dynamic string from iterating over files in an ItemGroup?

I need to create multiple /testcontainer: parameters to feed into a task that exec's MsTest. I have the following : for each match in TestFiles I would like…
RyBolt
  • 1,764
  • 3
  • 22
  • 34
6
votes
2 answers

How can I hide the command I'm using in an MSBuild Exec task from console output?

I've got a task in my MSBuild file like so: But in the console output it will dump the command: ... net use $(DeploymentServerName) /user:username…
peterw
  • 1,332
  • 2
  • 12
  • 23
6
votes
5 answers

Use XSD Build task in c# project

How can I use the c++ XSD Task in a c# project? I have already created the task in the csproj file like this:
m0sa
  • 10,712
  • 4
  • 44
  • 91
6
votes
1 answer

MSBuild: Generate XML documentation for main project but not dependency projects

I have a .sln file with several projects in it. To keep this simple, let's call them... ProjectA ProjectB ProjectC ...where A is the main project which references B and C. My goal is to update my build script to generate an XML "Intellisense"…
Nate Sauber
  • 1,118
  • 2
  • 10
  • 26
6
votes
3 answers

MSBuild referencing DLL's in Task

I have the following inline task defined in a .csproj file that should run BeforeBuild.
Jay
  • 2,141
  • 6
  • 26
  • 37