Click here to Skip to main content
15,867,756 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 Score

MSBuild 

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
12 Jun 2012 by Miroslav Popovic
MSBuild database migrations/upgrades with backup and restore functionality
17 Jan 2023 by Nick Polyak
Describes how to install dynamically loaded plugins as nuget packages
19 May 2014 by wliao
Integrating list of custom types into the TFS build template
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
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
14 Oct 2011 by Simon Bang Terkildsen
try google will ya, I just entered your question title into google[^] and see the results Using Sandcastle with CruiseControl.NET[^]Automatically generate SandCastle documentation using CruiseControl.NET or VSTS Team Build[^]CruiseControl.NET and Sandcastle Help File...
7 Sep 2012 by Sergey Alexandrovich Kryukov
There are can be at least two completely different things which may give different results. It depends on what you really need. (It's a good idea to start all questions from explanation of your ultimate purpose.)First one is: you can extract dependency information as it is prescribed in the...
9 Feb 2016 by Jim Roth
Use PowerShell Post-build scripts to check in binaries to TFS for continuous integration during the build process.
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...
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
9 Oct 2011 by Mehdi Gholam
Edit the following line (removed testcontainer:) :D:\Mymath\MyMathTest2\bin\Debug\MyMathTest2.dll
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
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
25 May 2012 by Vishant79
Hi Friends,I am trying to MSBuild a Web application programitically.I am able execute it from command line successfully and get the build.Please help me in getting the same done programitically.Thanks,Vishant
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...
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...
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...
24 Nov 2015 by ergohack
Here is a trick to create a Visual Studio solution that simultaneously builds multiple platforms for targeted projects.
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.
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"...
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...
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...
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.
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.
28 Sep 2011 by skumarn
Hi,I got below error while performing MSbuild automation for asp.net application with SVN using CruiseContro.NET. Please help me to rectify this error.https://202.63.108.3/svn/cruiseit/trunk/myfolder': SSL handshake failed: Secure connection truncated (https://202.63.108.3)
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
30 Sep 2011 by skumarn
Hi, Please tell me steps for how to use NUnit to perform unit test on windows application using msbuild with cruisecontrol.net
30 Sep 2011 by skumarn
HI, Please tell me steps to create a msbuild script to perform build automation with performing unit test on windows application
30 Sep 2011 by RaisKazi
Have a look at below link.http://confluence.public.thoughtworks.org/display/CCNET/Using+CruiseControl.NET+with+MSBuild
2 Oct 2011 by skumarn
Hi,Please tell me steps that are needed to run unit test on c# or asp.net project automatically using msbuild with cruisecontrol.net
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...
9 Oct 2011 by skumarn
Hi,I had created an automated build script to test unit test cases those were created by NUnit using CruiseControl.net.I had created one msbuild script as shown below: xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> "C:\Program...
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.
10 Oct 2011 by skumarn
Hi,While i am running Mymath , a c# application using NCover as shown below:C:\Program Files\NCover>ncover.console D:\Mymath\Mymath\bin\Debug\Mymath.exeI got below output:NCover is unable to write a file to 'C:\Program Files\NCover\coverage.nccov'because it it running without...
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:
29 Apr 2012 by sujanir
Hi,I am attempting to use TFS 2010 to automate - build and publish a website (CMS) to remote server and also deploy this to IIS. Currently this is being done manually.I am testing this on local server first. I am able to create a build without problems. The problem is that it does not...
30 Apr 2012 by sujanir
Hi, anyone ... any clues...?Am I missing something here?thanks
8 May 2012 by sujanir
Hi, The problem I face is my target 'CopyBuildFiles' does not copy as I think it is unable to find the build folder. The build folder is defined in the property $(BuildFolder), this folder name is created based on date.time and is created in one of the previous targets that runs before...
8 May 2012 by Sergey Alexandrovich Kryukov
Sorry if my post does not help you as you expect.I just don't think I have enough patience to find a "lost" folder for your. I used to do way more sophisticated master projects with special targets, but this is possible when you have everything in your hands and can debug the process (which...
14 May 2012 by sujanir
For those facing similar issues, if you are after a real solution, read on...MSBuild expects the property defined by itemgroup to be present inside of the target. Replacing ItemGroup tag with Createitem tag helped me to arrive at a solution. Put this in a separate target and call the target...
14 Jun 2012 by Henning Dieterichs
Hello!Curr...
1 Jul 2012 by Henning Dieterichs
I've asked the question here[^] and get the solution: Now,...
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
19 Sep 2012 by VSowmya
Hi,I am using $(ToolPath)tlbimp.exe in the pre-build event for VC# 4.0 project.I get this build error -"D:\Microsoft Visual Studio 10.0\Common7\IDE\tlbimp.exe"' is not recognized as an internal or external command, operable program or batch...
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...
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...
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[^]
24 Sep 2013 by Leo Gan
A Target for MSBuild, which I use with BizTalk Deployment Framework (BTDF) for the BizTalk Server application deployment.
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...
6 Oct 2013 by Richard MacCutchan
You probably need to look into the Visual Studio automation interface[^].
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
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...
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.
7 Oct 2014 by Dominic Burford
Deploying your WCF web service to IIS
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...
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...
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,...
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 :...
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...
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...
27 Apr 2015 by Sriharsha Denni
unable to generate deploy.webpage while Publish a ClickOnce Application using jenkinjs
22 Jul 2015 by Talal Tayyab
How to run a MSBuild custom task when publishing a SharePoint App using Visual Studio 2012.
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
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...
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...
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...
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 -...
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...
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...
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...
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....
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...
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.
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.
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 ...
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[^]
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...
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...
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...
29 Jun 2018 by Salman350
It is solved by the creater himself. I really dont know what he did. Thanks for your efforts.
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[^]
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 OriginalGriff
Probably the safest way is to fetch the executable path: Application.ExecutablePath Property (System.Windows.Forms) | Microsoft Docs[^]
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 CLN77
I had a similar issue. My solution was to add a MKDIR "$(SolutionDir)$(ConfigurationName)" before the copy.
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 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...