Click here to Skip to main content
15,887,385 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 

10 Oct 2011 by Abhinav S
Visit http://docs.ncover.com/[^] if you want to know more about NCover.This[^] should give you more information on how to integrate it with Cruise Control.
7 Sep 2012 by Andreas Gieriet
If you go parsing the files, you may do the following:parse the sln file for all Project...ProjectEnd entriesfrom these entries take the GUID and the path (if it ends on \.\w+proj)from these entries also take the ProjectSection(ProjectDependencies) = postProject (if it exists and store...
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...
28 Sep 2011 by Arindam Tewary
Hi,Please refer to this postshttp://ubuntuforums.org/showthread.php?t=1511387http://ubuntuforums.org/showthread.php?t=1711656http://www.svnforum.org/threads/35175-SSL-negotiation-failed-Secure-connection-truncated
7 Sep 2012 by aromore
Microsoft Visual Studio Solution File, Format Version 11.00# Visual Studio 2010Project("{00000000-0000-0000-0000-000000000000}") = "Test Projects", "TestProjects", "{5FAF487E-B913-4D46-983E-CB13FDF36FCB}" EndProjectProject("{11111111-1111-1111-1111-111111111111}")=...
10 Sep 2012 by aromore
Here is what i did...var filePath = @"C:\Users\xyz\Documents\Visual Studio 2010\Projects\test\test.sln" var slnLines = File.ReadAllLines(filePath); var projGuid = new List(); for(var i=0; i
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...
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
30 May 2011 by Beavis Killer
Details on how to use OneClick publishing in VS2010 to build and publish across domains using FTP or FTP with SSL.
23 May 2011 by Chasxu
Hi, I am building a 64 bit application. When I build the "projectA", there is an error:C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(3341,9): error MSB3097: File "C:\path\to\bin\projectA.dll" is not a valid assembly.Does anyone know what the problem...
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...
21 May 2019 by CLN77
I had a similar issue. My solution was to add a MKDIR "$(SolutionDir)$(ConfigurationName)" before the copy.
9 Jul 2020 by CodingCoyote
Tutorial using the Build Task NuGet Package Template with GitHub or `dotnet new`
23 May 2011 by Dave Kreskowiak
If your project is 64 bit and the .DLL you're trying to use is 32-bit it won't work and could come up with that error. You cannot combine 64- and 32-bit code in the same project or process.
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.
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...
5 Jan 2018 by debasish mishra
winapi - How to get the Windows SDK folder in MSBuild? - Stack Overflow[^]
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.
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...
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. ...
7 Oct 2014 by Dominic Burford
Deploying your WCF web service to IIS
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
24 Nov 2015 by ergohack
Here is a trick to create a Visual Studio solution that simultaneously builds multiple platforms for targeted projects.
7 Sep 2012 by Espen Harlinn
Apart from what Sergey mentions, you could look at the Solution2 interface[^] and the Project interface[^]Controlling Projects and Solutions[^]It's a lot of info to wade through, but what you're looking for is there somewhere.Best regardsEspen Harlinn
14 Jun 2012 by Henning Dieterichs
Hello!Curr...
2 Jul 2012 by Henning Dieterichs
This library provides a MSBuild task for compile time validation of units of measurement within C# code.
1 Jul 2012 by Henning Dieterichs
I've asked the question here[^] and get the solution: Now,...
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 ...
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...
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...
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 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...
9 Feb 2016 by Jim Roth
Use PowerShell Post-build scripts to check in binaries to TFS for continuous integration during the build process.
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.
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"...
14 Jan 2014 by Kevin Burek
Integrating GnuWin32 Flex/Bison preprocessing into the MSBuild build process under Visual Studio
10 Oct 2011 by koolprasad2003
before opening your command prompt do the following things1. Start --> All Programs --> Accessories --> right click command prompt click on Run as.. and select administratorand then run your command
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...
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...
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.
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...
24 Sep 2013 by Leo Gan
A Target for MSBuild, which I use with BizTalk Deployment Framework (BTDF) for the BizTalk Server application deployment.
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....
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...
25 May 2012 by Manas Bhardwaj
I would recommend stronlgy to go the official route via classes/interfaces in Microsoft.Build namespace. Esp. the class Microsoft.Build.Execution.BuildManager and the Singleton Microsoft.Build.Execution.BuildManager.DefaultBuildManager is what you are after to run a build task... source code...
3 Oct 2011 by Manfred Rudolf Bihy
Would you care to tell us which part of the message you are having problems with? It should be obvious that the configuration tells NUnit that there is an executable at location "C:\Program Files\NUnit 2.5.10\bin\nunit-console.exe". Did you check if this file exists at that location?Please...
23 Apr 2013 by marcofranssen
In this blog series I will explain to you how to set up continuous integration.
14 Jul 2014 by MarkPearlCoZa
MsBuild notes
1 Mar 2024 by Matt Bond
You need a DeployTarget. See Building and Packaging Web Application Projects
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...
30 Sep 2011 by Mehdi Gholam
CruiseControl has excellent documentation and samples on this subject : Integrating NUnit into your build in the CruiseControl.NET Server
9 Oct 2011 by Mehdi Gholam
Edit the following line (removed testcontainer:) :D:\Mymath\MyMathTest2\bin\Debug\MyMathTest2.dll
10 Oct 2011 by Mehdi Gholam
Use the following command line :C:\>ncover.console.exe //x "c:\coverage.nccov" D:\Mymath\Mymath\bin\Debug\Mymath.exe
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...
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...
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...
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...
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 ...
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...
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...
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...
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...
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...
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...
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...
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...
12 Jun 2012 by Miroslav Popovic
MSBuild database migrations/upgrades with backup and restore functionality
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
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...
28 Jun 2016 by mvastarelli
How to organize unit-tests within a library without the need for a separate test library.
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...
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...
17 Jan 2023 by Nick Polyak
Describes how to install dynamically loaded plugins as nuget packages
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...
21 May 2019 by OriginalGriff
Probably the safest way is to fetch the executable path: Application.ExecutablePath Property (System.Windows.Forms) | Microsoft Docs[^]
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 :...
6 Apr 2011 by Pete O'Hanlon
If you want to create MSBuild files, and only have Visual Studio solutions, take heart - there is a trick that will help you out.
12 Oct 2011 by Phillip Donegan
Struggling with this XPath expression, basically I need to extract the assembly name from a piece of xaml like this:
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. ...
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...
30 Sep 2011 by RaisKazi
Have a look at below link.http://confluence.public.thoughtworks.org/display/CCNET/Using+CruiseControl.NET+with+MSBuild
3 Oct 2011 by RaisKazi
Have you configured path of "nunit-console.exe" correctly in CruiseControl configuration file.Here is more information on this - Click Here
6 Oct 2013 by Richard MacCutchan
You probably need to look into the Visual Studio automation interface[^].
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...
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...
23 Jul 2020 by Richard MacCutchan
See node.js - How do I add VCBuild.exe to Windows 10 w/o Visual Studio - Super User[^].
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.
9 Sep 2020 by Richard MacCutchan
Getting error MSB3073[^]. Looking at the error messages your path backslash characters are getting removed from the paths.
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.
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.
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[^]
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 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 :)
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...
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[^]
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[^]