Click here to Skip to main content
15,887,328 members
Everything / MSBuild

MSBuild

MSBuild

Great Reads

by Sunasara Imdadhusen
MS Test Result Viewer is a free open source library to convert MS Test result (.trx) file into HTML. It is also allowed you to perform MS Test on your test container project (.dll) file. This utility will work with simple command line arguments to generate test report in HTML format with excellent U
by Miroslav Popovic
MSBuild database migrations/upgrades with backup and restore functionality
by Nick Polyak
Describes how to install dynamically loaded plugins as nuget packages
by wliao
Integrating list of custom types into the TFS build template

Latest Articles

by Sergey Alexandrovich Kryukov
MSBuild is a flexible tool, it can be used not only for Microsoft toolchains, and it can even be used for non-programming chores
by Nick Polyak
Describes how to install dynamically loaded plugins as nuget packages
by CodingCoyote
Tutorial using the Build Task NuGet Package Template with GitHub or `dotnet new`
by mvastarelli
How to organize unit-tests within a library without the need for a separate test library.

All Articles

Sort by Updated

MSBuild 

1 Mar 2024 by Matt Bond
You need a DeployTarget. See Building and Packaging Web Application Projects
28 Sep 2023 by Sergey Alexandrovich Kryukov
MSBuild is a flexible tool, it can be used not only for Microsoft toolchains, and it can even be used for non-programming chores
17 Jan 2023 by Nick Polyak
Describes how to install dynamically loaded plugins as nuget packages
31 Mar 2022 by DoingWork
I am trying to make a single project file for both Linux and Windows OS. Building solution on Linux OS through visual code, facing following Error. ...
3 Feb 2022 by DoingWork
Like in windows OS, AppInstaller.msi file, What is required installer extention for Linux/Ubuntu What I have tried: What tool will be suitable for build made by VSCode in linux ? I have made AppImage file it is not installer file, so...
3 Feb 2022 by Chris Copeland
The most popular is likely to be the .deb package format[^] which I believe is used in apt-get installations, and can also be installed manually over dpkg. Ideally you need a Linux environment to build the package, though on Windows you can...
8 Apr 2021 by Member 14859151
Currently in our company we are executing tests from CCNet (in Automation VM) by specifying different build arguments, however I feel it is now best to migrate to better automation server which is Jenkins I am new to Jenkins world however I...
5 Nov 2020 by jflarvoire
I'm trying to setup a Jenkins build system, to automate the build and test of our project when a developer pushes code into our internal github server. The build system is a Windows Server Core with Jenkins and MSBuild. This works fine for a...
10 Sep 2020 by Member 13187373
I am working on Winforms projects. I am facing a build issue (in release mode) on Jenkins server which is running on a remote machine. Below is the error on Jenkins log: "D:\Nightly\DataStore.NET\Client\mainline\DataStoreClient.sln" (Rebuild...
9 Sep 2020 by Richard MacCutchan
Getting error MSB3073[^]. Looking at the error messages your path backslash characters are getting removed from the paths.
24 Jul 2020 by VD-Flash
Hello readers. I was having problem in building a project with MSBuild so I asked for a solution here. A humble person named Shao Voon Wong suggested me to use the command line tools which I could download from here. After looking at this I...
24 Jul 2020 by Richard MacCutchan
Yes. As Gerry suggests above, instead of asking whether things can be done, just try it and you will find the answer immediately.
23 Jul 2020 by VD-Flash
Hello readers. I am trying to run MSBuild through command line but it keeps giving me the same error. It says it cannot run Visual C++ component VCBuild.exe. Any solutions to this problem ? Thank you for reading. What I have tried: I've...
23 Jul 2020 by Shao Voon Wong
You can download the command line VC++ tools here. Microsoft C++ Build Tools without Visual Studio[^]
23 Jul 2020 by Richard MacCutchan
See node.js - How do I add VCBuild.exe to Windows 10 w/o Visual Studio - Super User[^].
9 Jul 2020 by CodingCoyote
Tutorial using the Build Task NuGet Package Template with GitHub or `dotnet new`
30 Apr 2020 by RickZeeland
Maybe you can use this VS add-in: Versioning Controlled Build[^] You can read the CodeProject article where it mentions "Increment modified projects" under Batch Commands: Versioning Controlled Build[^]
30 Apr 2020 by Member 10053160
I am creating patch for my application to deploy small changes to customer. In my application I have 100 .CSProject. Out of 100 library I made code changes in class library A, B, C and Library D is calling to A,B and C library. So Is there any...
13 Apr 2020 by RickZeeland
You seem to have the answer already in your example: bin\Debug\ More information here: Common MSBuild Project Properties - Visual Studio | Microsoft Docs[^]
8 Feb 2020 by Member 11072126
Hi All, I have been assigned a VC++ project and its my first time am working on a VC++ project. The project was earlier built on visual Studio 2015 and I can see a Post-Build event being mentioned in project properties where it is calling a batch file - "vsvars32.bat". Am using Visual Studio...
8 Feb 2020 by Richard MacCutchan
1. The Platform Toolset is used to define the various library and platform versions required to generate the correct code for the application, e.g x86, x64, Windows version etc. 2. These environment settings are used only within Visual Studio, or in a batch process where you invoke the compiler...
15 Jan 2020 by Member 12658724
I have the script for post build event. copy /y "$(SolutionDir)Libs\MotionDetect.dll" "$(SolutionDir)$(ConfigurationName)" call editbin.exe /LARGEADDRESSAWARE SER.EXE > recpost.txt call dumpbin.exe /HEADERS SER.EXE > recpost1.txt I don't know what is wrong. But I get exited with code 1 ...
15 Jan 2020 by Quellkot
1. All codes smaller 8 are successcodes 2. Code 1 means "Successfully copied" 3. for some reason my visual studio alway threw "Code 1" as an exception which is bullshit 4. i had to fix it by simply adding the following line in the end: exit 0 Hope i could help. @Microsoft... if you read...
17 Oct 2019 by RickZeeland
You probably need to Install the MSBuild Plugin for Jenkins, read article here: hci-cd-using-jenkins-and-dotnet[^] Also see: .NET Application Continuous Integration ( CI ) using Jenkins[^] You might also consider using TeamCity which is considered as better suited for .NET solutions, read...
17 Oct 2019 by Member 14626393
I want two .net projects to be built separately using one solution file in Jenkins. If I complile them I want the packages to be dropped separately in each project Kindly help on this -.net14.0 _msbuild - execute the build using Windows command in jenkins What I have tried: I have tried to...
21 May 2019 by irfankhan200
Hi, I want to get the name of project build output folder e.g if Build configuration is Debug then it should be bin/Debug or if Build configuration is Release then it should be bin/Release. I have used following code Microsoft.Build.Evaluation.Project project = new ...
21 May 2019 by RickZeeland
I found some examples that show how to use project.GetPropertyValue(): Project.GetPropertyValue, Microsoft.Build.Evaluation C# (CSharp) Code-Beispiele - HotExamples[^] Hope you find this answer more helpful :)
21 May 2019 by CLN77
I had a similar issue. My solution was to add a MKDIR "$(SolutionDir)$(ConfigurationName)" before the copy.
21 May 2019 by RickZeeland
You can use: Assembly.GetExecutingAssembly().Location But not for a Windows service, then it's better to use: string currentDir = Path.GetDirectoryName(AppDomain.CurrentDomain.BaseDirectory) ?? string.Empty;
21 May 2019 by OriginalGriff
Probably the safest way is to fetch the executable path: Application.ExecutablePath Property (System.Windows.Forms) | Microsoft Docs[^]
26 Mar 2019 by Member 14197773
I have the below MSBuild to generate .cs files from my proto files. The build works fine until I do a rebuild where it complains of Source file 'generated-proto-output/Trade.cs# specified multiple times. How do I delete my .cs files before building/rebuilding everytime? Error Severity Code...
26 Mar 2019 by RickZeeland
Maybe you can use a build automation tool like Cake, see overview here: https://www.slant.co/topics/4014/~make-based-build-automation-tools[^]
29 Jun 2018 by Salman350
It is solved by the creater himself. I really dont know what he did. Thanks for your efforts.
29 Jun 2018 by Salman350
While I am trying to build my windows application, I am getting following error. The command "C:\repos\CommunityLive\CL_GateApp\signing\StrongNameUnsignedAssemblies.bat C:\repos\CommunityLive\CL_GateApp\signing\" exited with code 2. What I have tried: Following is my Pre-Build event...
20 Jun 2018 by Dave Kreskowiak
An error code (also exit code) of 2 means "File not found". So, somewhere in your batch file, a file was specified that doesn't exist and whatever command that tried to execute exited with that exit code. Since we know nothing about your batch file, it's impossible to tell you anything beyond...
24 May 2018 by Member 11635133
Hi, I'm creating MSbuild script to build our project and wanted to pass parameter from Jenkins to MSbuild. I have configured parameter value in Jenkins and I need to get that parameter in MSbuild script. Can any one please guide me what is the command to get parameter from Jenkins? What I...
13 May 2018 by Member 13825637
Why can't I build my Project with dependencies? What I have tried: In my Solution I have a Project (Project Main) with dependencies to four other Projects (Project A, B and C). If I execute the command msbuild [Project] /p:configuration=release on Project A, B and C, MSBuild will create my...
5 Jan 2018 by PrafullaVedante
Hi, I am migrating our VS 2008 solution to the VS 2017. Currently we have msvc90 include/src files in our repository. We just sync it to the build server.Hence we did not need to have a separate VS or WinSDK installation on the build server. We want to keep the same behavior after migration. ...
5 Jan 2018 by debasish mishra
winapi - How to get the Windows SDK folder in MSBuild? - Stack Overflow[^]
20 Sep 2017 by Member 9288201
I've tried several different commands and versions of MSBuild but I still can't generate a Web deploy package from it. I can, however, create one via Visual Studio 2017 using the same solution and pubxml file. What I have tried: I must be missing something in command line but I don't know...
8 Sep 2017 by Jochen Arndt
Probably one of the executed commands returns with a non-zero code. Unfortunately there is no documentation for the return codes of the VS tools but you can check them using the VS console or by printing them out in the build step: copy /y "$(SolutionDir)Libs\MotionDetect.dll"...
30 Jun 2017 by Arun Vasu
I have a situation to build multiple solution using MSBUILD in multi threading, but during build, always few solution get failed. I have try to build each solution one by one , its working perfectly. but i have try to build 5 solution using multi threading, few build get failed. As I...
30 Jun 2017 by RickZeeland
In failed.txt I can see that MsBuild has problems finding CopyArray_Test and searches in lot of places until it finds one that you probably did not intend. So make sure you have got your paths right, and maybe doing a Rebuild will help too.
21 Jun 2017 by Member 13272039
I have a solution developed in VS 2013 containing some 20 odd projects which used to build fine initially but now for past couple of days we are facing an issue where the build randonly hangs. I looked up in Task manager and noticed the process CSC.EXE is running but not doing anything...
21 Jun 2017 by RickZeeland
First thing I would do is check all running processes and close suspicious ones. Then check the Build order. Then check if there are no conflicts with x86 / x64 / AnyCpu. Rebuild all. If that fails then reinstall Visual Studio.
6 Apr 2017 by NadunS
Issue has been resolve by following below steps ,Jeff Kluge helped on this after raising this issue in GitHub(https://github.com/Microsoft/msbuild/issues/1947) Open Developer Command Prompt for VS 2017 Run cd /d C:\msbuildgit\msbuild Run git clean -xfd to clean the enlistment Run cibuild.cmd...
6 Apr 2017 by NadunS
I have cloned MSBuild source code from (https://github.com/Microsoft/msbuild) and followed below steps to build the project. Building MSBuild with Visual Studio 2017 >Install Visual Studio 2017. Select the following Workloads: -.NET desktop development - Desktop...
24 Mar 2017 by LiamD
Hi,Projects can be built by different versions of msbuild e.g. C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe C:\Windows\Microsoft.NET\Framework\v3.5\MSBuild.exe C:\Windows\Microsoft.Net\Framework\v2.0.50727\MSBuild.exeIs there any way to determine (e.g....
24 Mar 2017 by Dave Kreskowiak
There is no way to determine which version of MSBuild was used. There is no days in the executable that says which version was used and nothing in them specific to MSBuild to use as a trail of breadcrumbs to determine it either.You dont even need MSBuild to build an executable.
14 Mar 2017 by skumarn
Hi,Here is my Test.proj file code. xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> "C:\Program Files\MSBuild\MSBuildCommunityTasks\MSBuild.Community.Tasks.Targets"/> ...
14 Mar 2017 by OriginalGriff
Um. That doesn't look right at all: xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> Has a tag close ">" on the first line, and on the second.So does the next bit: "C:\Program...
26 Jul 2016 by vishalpankaj21
i want to create a windows form application in asp.net which will build the solution or projects pro-grammatically using ms-build .please provide me source code and give some idea What I have tried:i want to know i have to generate project file dynamically or directly i can create...
26 Jul 2016 by Richard MacCutchan
First you will need to install all the msbuild and .NET programs (compilers, resource generators, linkers etc.) required to create a forms application. You will then need some way of capturing source code in your ASP.NET web pages, saving it to some location on the server, generating the msbuild...
1 Jul 2016 by JaiswalVineet
Hello there,Greetings from India,Here my things which I want to achieve and related problem statementUltimate goal : implement continuous integration(CI) using Jenkin and msbuild script on web application (asp.net with c#), its journey will end once it will be deployed on IIS...
28 Jun 2016 by mvastarelli
How to organize unit-tests within a library without the need for a separate test library.
13 Apr 2016 by Denis Kuzmin (reg)
Explanation and architecture of powerful plugins system to MSBuild for flexible service of any projects and libraries, the build processes and processes at runtime.
21 Mar 2016 by jamesmc1535
i get a build error using xamarin , the program used to run , i did a reinstall on my new laptop and now it doesnt work , tried doing a recode still same error, im thinking the program has something it depends on is there a way to see what it might be? heres the build log -...
5 Mar 2016 by Maciej Los
As Richard MacCutchan[^] mentioned in the comment to the question, you can place it whenever you want. It depends on the menthod you wrote a script.If you wrote a script as follow:rem this script should be placed inside the main directory of solutionset...
5 Mar 2016 by krish8888
HI every one this is krishnaiam new to .net develpoment and msbuild and visual studio..now i have a one requirement.i want write a build automation for building .net applications.we are going to use jenkins a ci .now i have where should i want to write msbuild script..i...
9 Feb 2016 by Jim Roth
Use PowerShell Post-build scripts to check in binaries to TFS for continuous integration during the build process.
14 Jan 2016 by Member 23622
I experienced a similar problem. Where the output it was using was the default value for the rule. And Visual Studio would recompile the file every time because it was checking the wrong file for changes.I have something like this in my .targets file (that was auto-generated from a VS...
24 Nov 2015 by ergohack
Here is a trick to create a Visual Studio solution that simultaneously builds multiple platforms for targeted projects.
19 Nov 2015 by Duncan Edwards Jones
Each of these takes source files and creates the PE file. The command lines are documented on MSDN - for example MSBuild[^] :-So - if you had a visual studio solution file called "myprog.sln" you can compile it by:msbuild myprog.sln /target:Compile
19 Nov 2015 by tnkarthi
How can i create PE file manually.By using anyone of thesecsc.exemsbuild.exeildasmilasmby using command prompt.
19 Aug 2015 by virusstorm
I was recently placed on project that needs some tough love and care and one of my first actions is to setup continuous integration (CI). The problem I'm running into is the solution has a wide range of project types, all needed because of the way the application was designed, my MSBuild...
22 Jul 2015 by Talal Tayyab
How to run a MSBuild custom task when publishing a SharePoint App using Visual Studio 2012.
22 Jun 2015 by Southmountain
This tip shows how to build your own project file from scratch using MSBuild. It will deepen your understanding of project file made by Visual Studio IDE.
27 Apr 2015 by Sriharsha Denni
unable to generate deploy.webpage while Publish a ClickOnce Application using jenkinjs
22 Apr 2015 by Sergey Alexandrovich Kryukov
MSBuild project file standard offers you a declarative language used to formulate build rules, not imperative.That said, there is no any predefined order of build steps, but you can created this order if you specify dependencies between targets, even if those dependencies are fake. The...
22 Apr 2015 by Joan Magnet
Is there more than one project?If yes, compiler uses project's references to decide wich project must be compiled first, second, and so on.If there is only one project, order doesn't matter.
22 Apr 2015 by Southmountain
let's say I have a windows application project in C#, source files are thisfile.cs,thatfile.cs,plus.cs. thatfile.cs needs to be compiled before thisfile.cs is compiled. inside MSBuild file such as .csproj, how the build order of C# source files are decided? more specifically, how CSC task in...
4 Mar 2015 by Member 11497680
One of our customers uses Visual Studio Online which is based on capabilities of Team Foundation Server (TFS)We were researching how to do automated Builds and automated Unit Tests using the Visual Studio Online hosted build agent.We are trying to build one of our Web Applications on...
2 Feb 2015 by Pascal-78
Hi,I manage to build a custom build rule with VS2008 and upgrade it in VS2010.But I have a problem with the Outputs Property of the Rule in VS2010.Basically, I add a custom property name OutputSubDir (String) and I want to use it in the Outputs property like this :...
8 Jan 2015 by Stephen Hewison
Hi,I have a build process set up in TFS.This has been operating fine, but now is reporting a corruption in one of the projects.I've fixed the corruption, checked the changes in but the build is still failing.When I click the link in the build report and look at the project file,...
16 Oct 2014 by MSBuildMan
Microsoft has changed the way MSBuild handles DTD processing. Will have to rewrite scripts. Here's their response: https://connect.microsoft.com/VisualStudio/feedback/details/981375/wc-10-17-vs2013-msbuild-error-that-does-not-occur-with-net-v4-0-frameworkBottom line: Remove DOCTYPE...
13 Oct 2014 by Krishna Siva
HiI am working on a automating my deployment process with MSBuild for my mvc website. I build my solution, after that i follow steps till precompiling and I publish my project with web deploy. I can create a build aritifact (.zip file) but when I try to deploy that in my iis ( Clicking...
7 Oct 2014 by Dominic Burford
Deploying your WCF web service to IIS
7 Oct 2014 by Yamin Khakhu
The article presents CI for Asp.net Application using CruiseControl.Net.
26 Aug 2014 by MSBuildMan
I have VS2013 installed on a "clean" Windows 7 VM. Also installed in the system is the V4.0 .Net Framework. The following is a sample build script that demonstrates a problem I am having with a much larger script
21 Aug 2014 by Krishna Siva
Sorry, Use the first try option and run your vs command prompt as an admin. I have fixed it myself.
20 Aug 2014 by Krishna Siva
I am writing MSbuild scripts to automate my build process without using visual studio for building my application. Recently stuck up with this error " $(projectpath)\.nuget\nuget.targets(93,9): error : Package restore is disabled by default. To give consent, open the Visual Studio...
14 Jul 2014 by MarkPearlCoZa
MsBuild notes
26 May 2014 by vishalbisa
I have a small issue in a nant build file.Brief : we have a 2 build files EX (web and DB) which are independent and called seqentially..nant -buildfile:web.buildnant - buildfile:db.buildTo save time we are building it in parallel by adding a bat file and inside bat file we call...
19 May 2014 by wliao
Integrating list of custom types into the TFS build template
14 Jan 2014 by Kevin Burek
Integrating GnuWin32 Flex/Bison preprocessing into the MSBuild build process under Visual Studio
11 Oct 2013 by ASP.NET Community
Here's a few good places to start with MSBUILD, the new XML-based makefile system built into .NET. Basic Introduction to MSBUILD  MSBUILD MSDN
6 Oct 2013 by Richard MacCutchan
You probably need to look into the Visual Studio automation interface[^].
5 Oct 2013 by Iron-Eagle
I am interesting in writing custom logger for MSBuild and use it with VS 2012. But I did not found how, after that, can I call this logger from WITHIN VS 2012. I did not find any place where I transfer parameters to MSBuild, or can I set custom logger in VS 2012 preferences.Can someone help...
24 Sep 2013 by Leo Gan
A Target for MSBuild, which I use with BizTalk Deployment Framework (BTDF) for the BizTalk Server application deployment.
6 Jun 2013 by Stephen Hewison
Yes. In your project properties there is a platform setting which can be set to 32bit, 64bit or Any. You should be able to set this to force 64bit compilation.How to: Configure Projects to Target Platforms[^]
6 Jun 2013 by Angshuman1977
I have a website project in my .NET 4.0 solution. It has a reference to a 64 Bit dll. I am able to build / compile it from the command prompt. However, the build from Visual Studio fails with a bad image format exception, since Visual Studio by default uses the 32 Bit version of the compiler...
23 Apr 2013 by marcofranssen
In this blog series I will explain to you how to set up continuous integration.
5 Jan 2013 by Sebastian Solnica
MSBuild: MSB3275 Warning, GAC and .NET Version
23 Dec 2012 by Md. Rashim Uddin
When i tried to create a virtual directory in the remote server using Nant build script It could not create and shows the error msg below,"The webservice at 'remote_machine' does not exist or is not reachable"The OS of remote server is Windows server 2008. Here i have used nant 0.92 and...
16 Oct 2012 by Sunasara Imdadhusen
MS Test Result Viewer is a free open source library to convert MS Test result (.trx) file into HTML. It is also allowed you to perform MS Test on your test container project (.dll) file. This utility will work with simple command line arguments to generate test report in HTML format with excellent U