FAQ Database Discussion Community


Whats the real benefits of using the TFS Build 2013?

powershell,tfs,msbuild,tfsbuild,tfs2013
http://www.alexandervanwynsberghe.be/whats-new-in-tfs-2013-build/ I've only recently learned of the new TFS Build 2013 workflow. XAML and PowerShell, neither of which I want to use. We have a couple of thousand lines of msbuild script which does everything imaginable from change the version number to create help files. I've struggled for the past...

How can I define a project variable with candle in WIX?

msbuild,wix,installer,wix3.5
I want to take an existing project variable and extend it but I want it to be global so that I don't have to include it in each wxs file. The one I want to extend is: $(var.MyProject.TargetDir) I want to turn to make var.MyProject.TargetDir.Help=$(var.MyProject.TargetDir)Help\ How can I do this...

Error “No file format header found.” running NuGet restore

msbuild,nuget-package-restore
When I run Nuget.exe restore [path]\packages.config -PackagesDirectory [path]\build\packages it works as expected. However, the command Nuget.exe restore [path]\bigpackages.config -PackagesDirectory [path]\build\packages fails with the error: No file format header found. This is the case, even if I copy the packages.config file and rename it to bigpackages.config....

Nuget - unable to resolve package that could previously be resolved

.net,jenkins,msbuild
We have a nuget server set up and are using Jenkins for CI integration. For the past two months everything has been working perfectly, however today we got the following error after update one of our Nuget packages: Jenkins\Trunk\trunk\Solution.sln" (default target) (1) -> "F:\Jenkins\Trunk\trunk\Ioc\TPI.csproj" (default target) (44) -> F:\Jenkins\Trunk\trunk.nuget\NuGet.targets(100,9): error...

Transform T4 templates with MSBuild

c#,entity-framework,visual-studio-2013,msbuild
When trying to transform T4 templates, I got this error: Loading the include file 'EF.Utility.CS.ttinclude' returned a null or empty string. The transformation will not be run. I downloaded and installed the VS2013 SDK, Modelling extension, Data Tools... what else? EF 6 tools link doesn't seem to work. The following...

Can't build a project with Postsharp 4.1.14

c#,.net,msbuild,nuget,postsharp
I have a project which references a postsharp 4.1.14. When I build a project the error occurred. Postsharp is installed by nuget package. There is .net version 4.0 installed on computer, but Microsoft.Build.Utilities.ToolLocationHelper.GetPlatformSDKLocation method is from .net 4.5. Can I use different version of postsharp? Is there another way to...

MSBuild: Copy multiple directories in a generic way

msbuild
I have a Visual Studio solution with multiple web projects (e.g. WebappA, WebappB, WebappC). When TFS builds the solution it puts the build results in a _PublishedWebsites folder. The folder structure may look like this: $(OutDir) | +-- _PublishedWebsites | +-- WebappA | +-- WebappA_Package | +-- WebappB | +--...

VSCode appends taskName to msbuild automatically

msbuild,vscode
In Visual Studio Code (VSCode) I've create a task to build my c++ project. The build-process is based on Visual-Studio 12.0 projects files create by CMake. It provides configurations for Release/Debug/... modes and I want to create for each configuration a separate task. Problem: VSCode appends the taskName to msbuild...

New Automatic NuGet package resotore and NuGet.Config

.net,visual-studio-2013,msbuild,nuget,nuget-package-restore
I'm migrating to new version of Automatic package restore as described in docs This documents says, that .nuget folder should be removed completely. Including NuGet.Config, that contained a property, we need: <config> <add key="repositoryPath" value="..\..\..\commonNugetPackages" /> </config> So how one should specify path where packages should be restored? Update: Updating...

Emulate Devenv/Runexit under MSBuild

visual-studio,msbuild,build-automation
I am new to MSBuild and busy automating tests of Visual Studio solutions. I previously worked with the command line of Devenv, which provides a convenient /Runexit mode of operation. From the manual: /Runexit (devenv.exe) Compiles and runs the specified solution, minimizes the IDE when the solution is run, and...

How do VSOnline Automated Test Runs/Builds Differ From Local?

unit-testing,msbuild,visual-studio-online
I have unit tests that looks up a configuration file in a particular folder by determining the project path: /// <summary> /// Gets the project path of the given type. /// </summary> /// <param name="type"></param> /// <returns></returns> public static string GetProjectPath(Type type) { var dll = new FileInfo(type.Assembly.Location); if (dll.Directory...

Azure Cloud Service continuous integration with existing ccproj profile

azure,msbuild,continuous-integration,azure-web-roles,azure-cloud-services
How do I get continuous integration to work using publish settings from a profile in our Cloud Project? When using the default TfvcContinuousDeploymentTemplate.12.xaml, the publish ignores some of my profile settings. It doesn't use the correct storage account and always publishes to the Staging environment. Here are the settings for...

MSBuild: building of DefineConstants value

c#,visual-studio,msbuild
I heed to extend the current value of DefineConstants property of my csproj-file. The string, which I want to add as a suffix, can be evaluated on C# such: Int32 min_year = 2009; Int32 max_year = 2015; String result = String.Join(";", Enumerable.Range(min_year, max_year - min_year + 1).Select(n=>"NEWER_THAN_AUTOCAD_" + (n -...

How to get Visual Studio build process to create a distributable directory?

visual-studio,visual-studio-2013,msbuild
I would like to customize my Visual Studio Solution build to automatically create a directory tree with dist -> bin directories. The bin directory should have all binaries automatically copied to it. Note: the solution has many projects so I do not want to customize the project build, this should...

Include file in solution explorer without it being a build dependency

c#,visual-studio,msbuild,intellisense
How can I include a file in the list of files in solution explorer without including it as a dependency for compilation? I have a .targets file that generates .cs files, similar to the examples in this answer. <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <PropertyGroup> <CoreCompileDependsOn>$(CoreCompileDependsOn);GenerateCode</CoreCompileDependsOn> </PropertyGroup> <ItemGroup> <Sources Include="..\sources\*.txt" /> </ItemGroup> <Target Name="GenerateCode"...

Deploy Any CPU build with WiX to x86 using MSBuild

visual-studio-2013,tfs,msbuild,wix
I have a set of solutions that build a complete .NET Any CPU application. I have a WiX project that will deploy that application as x86 and I can run this all manually in Visual Studio 2013 without any issues. Now I'm trying to get this to work in MSBuild...

Migrate ClickOnce certificate from Sha1 to SHA256 and run on .NET 4.0 client machines

msbuild,certificate,clickonce,cruisecontrol.net,signing
After discovering the signing issue with .NET 4.5 vs .NET 4.0 when upgrading from an SHA1 to an SHA256 signed certificated, I decided to re-implement our ClickOnce build process to follow a more standard approach so I could make use of VS2013 Update 3. However it didn't seem to have...

TextTransform on MSBuild only when file modified? (or an alternate route of doing this)

c#,msbuild,code-generation,t4,roslyn
I have a project that integrates TextTransform with MSBuild, but I am now at the point that the files are too many and it is slowing down development time. The process that I have is, I have a POCO.cs; I use Roslyn to Parse the .cs file to gather some...

msbuild error building sql clr dll in TFS

tfs,msbuild,tfsbuild,tfs2013,sqlclr
We have SQL CLR dll that we developed quite a long time ago that we have been using. Unfortunately it wasn't ever in our normal daily builds.We are going to be upgrade our sql server from 2008 R2 to 2014. So i opened the project and upgrade it to a...

Wix Heat Error on Jenkins CI

jenkins,msbuild,wix,heat
I am building a wix bundle that depends on a wix setup project and the wix setup depends on a C# project. When I build locally, everything works great but when I build the bundle on Jenkins, I get an error when I try to harvest some files. The heat...

How can I create a cycle of compiling my project with incrementing of some option?

visual-studio-2010,visual-studio,visual-studio-2012,msbuild,msbuild-task
I wrote a C# template for creating of the .Net extensions for AutoCAD. Before, for each AutoCAD version it is was necessary to point the individual referenses set, the output directory, the target .Net Framework Platform, etc. Exist many versions of AutoCAD: AutoCAD 2009, 2010, ..., 2015. Now my template...

OmniSharp error loading projects with COMReferences in Visual Studio Code

c#,msbuild,csproj,vscode,omnisharp
Having issues loading projects in the new Visual Studio Code that work fine in Visual Studio 2013. I was able to load other projects that don't have COMReferences in Visual Studio Code. Using Windows 7 Enterprise. Relevant snippet from .csproj file: <ItemGroup> <COMReference Include="DTOLib2"> <Guid>{DBE2B0CE-6BE9-48FE-8300-6ABE0DB9692B}</Guid> <VersionMajor>1</VersionMajor> <VersionMinor>0</VersionMinor> <Lcid>0</Lcid> <WrapperTool>tlbimp</WrapperTool>...

Msbuild variable with original target

visual-studio,msbuild
Is there a variable containing the original target invoked for msbuild? Basically in Visual Studio I'd need to call a powershell script only on publish. Update: After Alexey's answer, I've tried this: <Target Name="DeployToAzure" AfterTargets="CopyPackageToDropLocation"> <PropertyGroup> <PowerShellExe Condition=" '$(PowerShellExe)'=='' "> %SystemRoot%\sysnative\WindowsPowerShell\v1.0\powershell.exe </PowerShellExe> </PropertyGroup> <Exec Command="$(PowerShellExe) -ExecutionPolicy Unrestricted -noprofile...

Windows logon name of the user on whose behalf the code is being run

jenkins,msbuild,msbuild-4.0
I've googled and checked 2 resources. I have msbuild.exe calling a myproject.proj file. Is there a way to report the IIDentity of the identity running the process? I did not find anything under the "Common MSBuild Project Properties" or "Jenkins Environment Variables". I know I could write a custom task...

Why the `Condition` attribute doesn't work for the `ItemGroup` element?

visual-studio,visual-studio-2013,msbuild
MS Visual Studio 2013. Both When and ItemGroup elements can to have the Condition attribute (as I see in MSDN). But I get different results. When $(CAD_Year) is 2015, I expect the AcRibbon will be not referensed to my project: <ItemGroup Condition= "'$(CAD_Year)' &lt; '2010'" > <Reference Include="AcRibbon"> <HintPath>$(CAD_SDK_Location)\$(Inc)\AcRibbon.dll</HintPath> <Private>False</Private>...

The target “TransformAll” does not exist in the project T4 transformation MSBuild

visual-studio-2013,.net-4.0,msbuild
I want to transform my T4 templates using MSBuild, so I found this link. But when running: msbuild solution.sln /t:TransformAll I get the following error "The target "TransformAll" does not exist in the project". The same happens if I try to compile a single project. No matter if I open...

Execute build file for Teamcity locally

deployment,msbuild,command,teamcity
I'm going through the tutorial from this website which explains how to use a custom MSBuild script (*.build). Because I'm new to this topic my question is how I can locally test the custom MSBuild script without Teamcity/VCS. Knows anyone the command for the command line? Or isn't that possible?...

msbuild clcompile specification? (Mapping of switches to XML properties)

xml,msbuild,tags,specifications
Is there a document that maps the command line switches to the MSbuild properties for a Visual C++ project? The closest I've got is found in the Microsoft.CL.common props file that is shipped with MSBuild. However it is not complete for what I am looking for. I am trying to...

Where has BuildStep gone?

visual-studio-2013,msbuild,tfsbuild,tfs2013
I'm reusing 2010 tfs build scripts in TFSBuild 2013. I've had to remove my BuildSteps because the task is no longer valid! What is the recommended alternative to logging progress to the TFSBuild 2013 "Activity Log" ?...

Overwrite proj property with msbuild switch

.net,msbuild
Given the following proj snippet: <Project DefaultTargets="artifacts" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <PropertyGroup> <msbuild40>"msbuild.exe"</msbuild40> </PropertyGroup> <Target Name="compile"> <Exec Command="$(msbuild40) src\ClientFrameworkLoader.sln /t:Build /p:Configuration=Debug;platform=win32" /> <Exec Command="$(msbuild40) src\ClientFrameworkLoader.sln /t:Build /p:Configuration=Release;platform=win32" /> </Target> </Project>...

Why would one compile all projects to one directory?

visual-studio-2010,visual-studio,build,compilation,msbuild
Extending this questions, I want to know, what is the reason, one would want to compile multiple projects to a single directory? Thank you. ...

How to get an XML report out of MSBuild Code Analysis

c#,visual-studio,msbuild,code-analysis
Running MSBuild with /p:RunCodeAnalysis=trueon a C# project does generate the code analysis warnings on the build output, but what's the switch that lets me export these warnings (only the code analysis warnings not the entire build output) to an XML file?

MSBUILD : error MSB3428: Could not load the Visual C++ component “VCBuild.exe”

python,ruby,node.js,msbuild,node-gyp
I am trying to install nodejs from a long time now. I tried it searching over the google but seriously i had not got any working solutions. My first question is that Why Nodejs require Microsoft Visual component? Secondly as per suggestion on google i tried below things Installed Visual...

Reference latest Microsoft.Build GAC assembly in F# Interactive?

f#,msbuild,f#-interactive
How do I reference the latest Microsoft.Build in the GAC from a .fsx? When I do #r "Microsoft.Build" I always get version 4.0.0, but I want 12.0.0 to load. #r "Microsoft.Build" open Microsoft.Build.Evaluation printfn "%s" typeof<ProjectCollection>.Assembly.Location This will help me solve this issue. EDIT #1: Doing a fully qualified assembly...

msbuild set path to CL

visual-studio,msbuild,clang
I'm trying to take a couple of projects normally compiled on Windows with Microsoft C++ and compile them with clang instead. On the upside, there exists clang-cl.exe which is designed to be a drop-in replacement for cl.exe. However, even when I copy clang-cl.exe into the current directory as cl.exe, msbuild...

Set version Info does not exist error after installing MSBuild Extension Pack for DotNetNuke module creation

visual-studio-2012,msbuild,dotnetnuke,msbuildextensionpack
The PC at work finally kicked the bucket and I needed to install MSBuild Extension Pack on my new PC so that I could continue creating DNN modules for my website. For whatever reason after I install it, I am getting the same error as if it is not installed...

Can I use the system variable names in the msbuild settings?

msbuild
Can I use the system variable names in the msbuild settings? I want to write something like that: <Import Project="%ProgramData%\MyCompany\config\AutoCAD\acad-common.props" /> instead of that: <Import Project="C:\ProgramData\MyCompany\config\AutoCAD\acad-common.props" /> ...

Build a csproj with a specific version of C# [duplicate]

c#,msbuild
This question already has an answer here: Make each csproj in a solution target a different C# version 2 answers I have a csproj file that I want to build with C# 1. I haven't been able to determine how to target a specific version of the language. How...

pre-build script path not logging output

tfs,msbuild,npm,build-definition
I have a pre-build PowerShell script defined in my Build Definition. The PowerShell script execute a program: & "c:\Program Files\nodejs\npm.cmd" "run" "build" When npm runs, npm writes things to stdout/console. This output doesn't show up in my logs for the build though. What do I need to do to make...

Bamboo build stuck on “Waiting to be built…” and Cloning into 'Common'

git,msbuild,continuous-integration,bamboo
For some reason my bamboo build which uses MSBuild is stuck for past 4 hours with message below: "Waiting to be built...". I tried stopping the build but stuck on 'Cancelling....'. Can't even disable the Agent. Weird thing is there are 2 build agents in IDLE. Before I stopped build,...

Build process hangs when recursively building solution

c++,visual-c++,visual-studio-2013,msbuild
While trying to answer this SO question I encountered an issue which I cannot explain and would appreciate your input on. Setup: Have solution consisting of several C++ projects (Test.sln), Add a brand new project to your solution (BuildInstaller.vcxproj), Open BuildInstaller.vcxproj in text editor and append following xml fragment right...

VS2013 devenv Command Line Build Errors/Hangs

visual-studio-2013,msbuild
We recently converted our VS2010 projects to VS2013. All projects build fine in the IDE. However when we do command line builds it appears to build a few projects (it's inconsistent sometimes 1, other times 3 or 4), and then just hangs. In the event log I see this: The...

How to define WIX agent requirment in TeamCity?

msbuild,wix,teamcity
I have add a WIX installer project to solution in Visual Studio 2013. The project is built with every commit on TeamCity. There are several build agents connected to TeamCity cloud, but only some have WIX installed. Usually I would add the build agent requirement, so only the computer with...

Nuget PCL library conflict

c#,.net,msbuild,nuget,portable-class-library
I'm using Nito.Async both in a PCL framework library and in client app which uses the library. The PCL lib targets .Net4.5 & SL5, and the client is .Net4.5. If I don't reference Nito.Async in client app, everything is fine. But if I reference it, when i run the app,...

Use filter metadata in custom build tool VS2012 MSBuild

visual-studio,visual-studio-2012,msbuild,msbuild-task,custom-build
I have a problem which I want to solve elgantly, but for now don't know how to do it. In my C++ solution(VS2012) I have a project which contains all .dll files which have to be copied into the Output-Directory for complete deployment. I have also written a small Custom-Tool...

Move DLLs to Azure Cloud Service deployment package

.net,visual-studio,azure,msbuild,azure-cloud-services
Is there solid, no-fuss way to copy a file to an Azure cloud service deployment package without including or referencing it in the web project? We have a site that we will be hosting both as a web role in an Azure cloud service project and on-premises, each requiring different...

wpf prism mef visual studio project file

wpf,visual-studio-2013,msbuild,projects-and-solutions
I've got a WPF/Prism 4.0/MEF(MVVM) application. Everything runs/loads fine, except when I Change the Project file. The Version that works contains the following, but the Project browser does not load the *.cs code-behind files into the tree hierarchy correctly. The code-behind files are inserted at the same tree level as...

TFS Build Server not running NUnit TearDown

tfs,msbuild,nunit,build-process,tfsbuild
I have a global teardown in my unit tests as below: [SetUpFixture] public partial class TestRunTeardown { [TearDown] public static void Teardown() { Trace.WriteLine("getting to tear down"); } } The trace outputs in my local window pointing to the same database, but when I run on the TFS build server...

CreateFileA returns error 20, “The system cannot find the device specified” intermittently

c++,winapi,msbuild,createfile
I am debugging a custom exe during the compiling of my code using the msbuild exec task. It runs the following code: HANDLE hFile = CreateFileA(szFile, GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, NULL); if (hFile == INVALID_HANDLE_VALUE) Fatal(szFile, 1, "unable to open file (%x)", GetLastError()); szFile is the dll/exe...

tfs 2013 incremental build number across build defenitions

msbuild,tfs2013
I am wondering how you could implement a incremental build number that is shared by several different build definitions. For example, I one build definition for our staging environment which has a build number of say 15.3.6.1. I then queue a build for production, different build definition, I want that...

Could not copy. The process cannot access the file because it is being used by another process

tfs,msbuild,tfs2012,visual-studio-online,tfs2013
I am getting the following error when running my build on Visual Studio Online (using the built-in Build Controller): C:\Program Files (x86)\MSBuild\14.0\bin\amd64\Microsoft.Common.CurrentVersion.targets (3962): Could not copy "d:\a\src\MySolution\MyProject\Trunk\packages\Microsoft.Data.Edm.5.6.4\lib\net40\Microsoft.Data.Edm.xml" to "..\Build\bin\Release\Microsoft.Data.Edm.xml". Beginning retry 1 in 1000ms. The process cannot access the file '..\Build\bin\Release\Microsoft.Data.Edm.xml' because it is being used by another process. It...

Is it possible to write build message from powershellscript?

powershell,msbuild,tfsbuild
If i have a build template for TFS, and in this template in post-build script row i make a call to a powershell script, are there any way to transfer output from this PS script to build log?

VisualStudioOnline NuGet Restore now built in?

msbuild,nuget,visual-studio-online,tfs2013,nuget-package-restore
Is the Host Controller on Visual Studio Online now automatically restoring NuGet package before calling MSBuild? Previously I had to manually execute the following: nuget.exe restore MySolution.sln Now, when creating a new build in a new project, I noticed that I didn't need to do this. When looking at the...

How to setup a TeamCity build for a ASP.NET 5 project

msbuild,teamcity,asp.net-5,dnx
I'm trying to setup a CI server for a website that I'm developing, but I can't find any info regarding how to do it with the new ASP.NET 5.

What is the proper way of using /p per build step in a TeamCity build configuration?

msbuild,teamcity
In TeamCity I created a Build Configuration with two msbuild Build Steps which should build a Solution .sln file. I defined the target as "Build", when I run the build, both steps obviously execute the standard configuration and both build either Debug or Release configuration twice. Now I went to...

How to create MSdeploy Package using MSBuild for all files in this project folder

asp.net,iis,msbuild,msdeploy
I'm trying to create a web deploy package using msbuild through command line. I have been searching all over and found the following command msbuild myproject.csproj /t:package Though it works for me but it gives me only what visual studio gives us back when we create web deploy package through...

Reading msbuild syntax

c#,msbuild,msbuild-task
I've run across msbuild syntax that I don't understand. The following snippet is from another question about making a custom msbuild task <GenerateDesignerDC InputFiles="@(dbml)" OutputFiles="@(dbml->'$(IntermediateOutputPath)%(FileName).designer.cs')"> ... What does @(dbml->'$(IntermediateOutputPath)%(FileName).designer.cs') mean? The @ sign usually references the files in an ItemGroup; what does the -> arrow inside an @(...) mean? What...

AzureContinuousDeployment.11.xaml vs TfvcContinuousDeploymentTemplate.12.xaml

azure,msbuild,tfsbuild,azure-web-roles,visual-studio-online
I can't seem to find any information regarding the difference between these two build definition templates: AzureContinuousDeployment.11.xaml TfvcContinuousDeploymentTemplate.12.xaml My guess is that AzureContinuousDeployment has been replaced by TfvcContinuousDeploymentTemplate. Does this mean I should not use AzureContinuousDeployment? I want to use it because here I am able to set the storage...

Trying to publish an azure webjob from visual studio 2013 update 4

c#,azure,visual-studio-2013,msbuild,azure-webjobs
I've been trying to get a very simple Azure webjob deployed from visual studio 2013. I've written the job it just outputs some stuff to the console and now I'm trying to deploy it. I clicked "Deploy As Azure Webjob" and got an error saying that the deploy target couldn't...

vstest.console.exe not generating trx file, TestResults empty

msbuild,mstest,xunit,vstest,visual-studio-test-runner
I am trying to run below command on my build server, c:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\CommonExtensions\Microsoft\TestWindow\vstest.console.exe" "C:\UnitTest\MyTests.dll" /settings:"C:\UnitTest\output.runsettings" /UseVsixExtensions:"true" /InIsolation /Logger:"trx" <?xml version="1.0" encoding="UTF-8"?> <RunSettings> <RunConfiguration> <ResultsDirectory>.\TestResults</ResultsDirectory> </RunConfiguration> </RunSettings> It generates TestResults folder which...

error MSB4062: The “MSBuild.ExtensionPack.Web.Iis7Application” task could not be loaded from the assembly MSBuild.ExtensionPack.Iis7.dll

c#,msbuild
Receiving this error when trying to build my application using msbuild: error MSB4062: The "MSBuild.ExtensionPack.Web.Iis7Application" task could not be loaded from the assembly MSBuild.ExtensionPack.Iis7.dll. Could not load file or assembly 'Microsoft.Web.Administration, Version=7.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified. Confirm that the <UsingTask>...

Where can I find Microsoft.TeamFoundation.Build.Client in Visual Studio 2015?

tfs,msbuild,visual-studio-2015,tfs2015
I have a clean windows installation with just Visual Studio 2015 installed and I'm looking to find the Microsoft.TeamFoundation.Build.Client assembly? I'm wondering if it has now been made obsolete with the upcoming vNext Build or if the namespace moved? or something else? The MSDN documentation only goes up to Visual...

npm fails saying “The build tools for VS2010 cannot be found”

msbuild,npm,node-gyp,hubot
I'm trying to install Hubot on my local machine. Going well so far until I have encountered this error. The Error is pretty clear: Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch. However I am running the Hubot Initialization...

How can i execute sqlite (sqlite3) statements in MSBUILD, the Exec Task?

sqlite,sqlite3,msbuild
I am trying to run some queries on my sqlite database after building my application. I have tried; <Exec Command='sqlite3 "@(DeployedSqliteDbPath) DELETE FROM BatchConfig";'/> and <Exec Command='sqlite3 "@(DeployedSqliteDbPath)";'/> <Exec Command='sqlite3 "DELETE FROM BatchConfig";'/> But it doesn't seem to work. Can someone help?...

WiX error build target

msbuild,wix,installer
I'm trying to create my MSI setup with WiX and MSBuild command which deploy my img.png into a repertory and i have this error : "MSB4019: project imported "C:\Program Files\MSBuild\Microsoft\WiX\v[[Version.M ajor]].x\Wix.targets" was not found. " Make sure that path of declaration are correct In this line : <Import Project="$(WixTargetPath)" />...

Portable Class Libraries not recompiling when Windows Phone app is in ARM build configuration

c#,msbuild,windows-runtime,windows-phone
I've just started working with the Lumia (formerly Nokia) Imaging Library. Due to some restraints of the library it is necessary to use either the ARM or x86 build configurations. That's fine, but I have three portable class libraries that are referenced by the app. Whenever I make changes to...

Elastic Bamboo CI Windows Server - MSBuild 12 not publishing

c#,visual-studio,visual-studio-2012,msbuild
I have a custom image with Node.js, Microsoft Build Tools 2013, Windows SDK for Windows 8.1, .Net Framework 4.5.1 SDK, Microsoft Test Controller for Visual Studio 2013, Microsoft Agents for Visual Studio 2013 and Microsoft Web Deploy 3.5 installed. Most things are working but I am struggling to get the...

TFS Build - Get Assembly Version Info

visual-studio,tfs,build,msbuild
Is there a simple way to set the TFS Build Number to be an Assembly Version during build? I've seen many examples of the other way around (i.e. a build number updates the assembly version). We already use the SharedAssemblyInfo implementation from here, so we would like to leverage this...

ProjectGuid (.csproj), how to generate it correctly?

c#,visual-studio,msbuild,guid,projects-and-solutions
I'm creating an app. to change the namespace of multiple projects (solution), I copy the content to another location, change folder names, replace text in files content (old namespaces with new namespaces), all is OK. The solution has folders(these folders only exist in the solution, in VS) and every folder...

Prevent TFS Build Definition Source Settings from triggering a build

tfs,msbuild,tfsbuild,build-server,build-definition
When I create a build definition I have setup some source settings, example below: Problem is I want it to trigger a build when someone checks into the Builds or Install folders, but the Includes folder is just some libraries and other items it needs. I don't want it to...

Does Roslyn actually allow you to manipulate TreatWarningsAsErrors for a CSharp project?

c#,msbuild,compiler-warnings,roslyn
I'm trying to retrieve the setting TreatWarningsAsErrors, but I'm unable to find it for a project of my loaded solution. What I'm trying to accomplish, is to get the setting from the project files, and set it to true, if it's not already that. Next, I want to let Roslyn...

Unused results from Entity Framework database call

c#,entity-framework,msbuild,dbcontext,compiler-optimization
Any decent compiler should eliminate dead code, at least to a certain extent. However, I am curious how a compiler (specifically MSBuild) handles a situation like the following: // let's assume LazyLoadingEnabled = false; var users = db.Users.ToList(); // more code that never touches 'users' Since LazyLoadingEnabled = false, will...

ItemGroup include files with condition

msbuild
In MSBuild 12.0, can I include files in an <ItemGroup> only when a condition is met? My use case is that I want to create a collection of all .csproj files for which a .nuspec file with the same name exists (without extension). - root_dir\ - build.proj - Project1\ -...

Continuous integration AND NuGet restore in VSO and Azure

azure,msbuild,nuget,azure-web-roles,build-definition
We are using VSO and Azure Cloud Services (web roles). Previously, we have used the following build.proj file for our VSO build definitions: <?xml version="1.0" encoding="utf-8"?> <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <PropertyGroup> <OutDir>$(MSBuildThisFileDirectory)bin</OutDir> <Configuration>Release</Configuration>...

How can I bulk set all cshtml MVC views to build action None?

asp.net-mvc,razor,visual-studio-2013,msbuild,razorgenerator
I am using RazorGenerator so don't need to include cshtml files in my deployment as I have the compiled pages. All pages are compiled using Custom Tool RazorGenerator but have their build Action currently set to content. When I package up the solution they get included increasing the size of...

How do I use a localized PostBuildEvent in an environment with multiple collaborators?

git,visual-studio,msbuild,visual-studio-2015
I have a project which has the following PostBuildEvent: <PostBuildEvent> if exist Diagnostic.nuspec if exist "$(SolutionDir)\packages\NuGet.CommandLine.2.8.2\tools\NuGet.exe" "$(SolutionDir)\packages\NuGet.CommandLine.2.8.2\tools\NuGet.exe" pack Diagnostic.nuspec -OutputDirectory "C:\Users\jeroen\Google Drive\NugetLocal\VSDiagnostics" </PostBuildEvent> Here, the OutPutDirectory is obviously local to my own installation. The default value is .. This configuration is stored in the project's .csproj file which also keeps...

Relationship between SonarQube Runner and SonarQube.MSBuild.Runner

tfs,msbuild,sonarqube,sonar-runner
Regarding the announcement of SonarQube integration with MSBuild and Team Build, can anyone advise on the relationship between SonarQube Runner and SonarQube.MSBuild.Runner? I'm unclear whether SonarQube.MSBuild.Runner replaces SonarQube Runner or whether it sits on top of it.

How do ASP.NET Web APIs work once built with MSBUILD?

c#,asp.net,msbuild
I'm new to coding and spend most of my time in mobile application development with Phonegap, I've been learning how to code ASP.NET Web APIs and I know how it generally all works while having the code open in front of me but --- I was asked a question today...

TFS 2012 not copying transformed Web.Config to _PublishedWebsite

tfs,msbuild,web-config,tfs2012,octopus-deploy
I have a web project with a config transform. On my local machine, when the project is built, the transform works fine. However, my project is pushed to TFS and built there, the config file is transformed in the main drop folder; However, the version in _PublishedWebsites is the original,...

Octopack for .Net 2.0 and msbuild 2.0

msbuild,octopus-deploy,octopack
I was setting up number of projects to build NuGet packages and push onto NuGet server, so it could be later used by Octopus Deploy. All was fine until I needed to apply the same process to legacy projects. The error was: error MSB4062: The "OctoPack.Tasks.CreateOctoPackPackage" task could not be...

Visual Studio add pre-build event that always runs (C# project)

visual-studio-2013,msbuild,pre-build-event
In my project I am running an external tool to update some binary files. These files are included in the project as "content". At the moment the tool is set to run during "pre-build event" in C# project properties. Unfortunately this event is only executed if the project is out...

Exclude/Remove .csproj through MSBuild argument

visual-studio-2013,msbuild,tfsbuild
I need to exclude abc.Test.csproj from the .sln file during team build compilation. I have tried using /ignoreprojectextensions=.Test.csproj, but doesnt work for my purpose. Please help me in accomplishing this....

How to modify TFS build automation workflow without .Net Complier, need to use Team Developer's Language complier

tfs,msbuild,tfs2010,tfsbuild
I am trying build automation for a project developed using legacy language called Team Developer 6. where each file needs to be compiled as an exe. also need to do some filter activity before building exes. there are 300 exes. this process I could do in simple .Net utility which...

Make each csproj in a solution target a different C# version

c#,msbuild
I have a solution that contains five C# console application projects. I would like each project to target a different version of C#. MyLearningSolution.sln CSharp01.csproj CSharp02.csproj CSharp03.csproj CSharp04.csproj CSharp05.csproj Is there a way to do this either via Visual Studio or via editing each csproj file? I have tried the...

Runtime Mismatch in Visual Studio 2012

c++,visual-studio-2012,msbuild,static-libraries,linker-error
This is the first time I'm asking a question here, so pardon me if I miss some of the etiquette. I have a solution that was originally a VS2008 one, I have migrated it to VS2012 and that didn't create a problem. My solution uses DCMTK static libraries so I...

TFS Build Services, environment variables and multiple build agents

tfs,msbuild,tfsbuild,tfs2013
I have a MsBuild process that start as part of build using TFS Build Services 2013. I need to pass a few parameters to this process (for example the build number). I've done this previously by modifying the build template and added these parameters to the list of parameters sent...

Typescript 1.4 SDK for build server?

visual-studio-2013,tfs,msbuild,typescript,typescript1.4
I've updated to Visual Studio 2013 Update 4, which includes Typescript 1.4. I've updated my project file with this, and everything works fine locally. <TypeScriptToolsVersion>1.4</TypeScriptToolsVersion> However, the build server has not been updated with the Typescript 1.4 SDK. Builds are now failing with this error message: C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\TypeScript\Microsoft.TypeScript.targets (95):...

CC.NET: Multiple MSBuild-Tasks within a single project

msbuild,cruisecontrol.net
In CruiseControl.NET 1.8.4, I'm running a single project with multiple MsBuild-Tasks. A short excerpt from the project configuration, parsed and validated by the CCValidator: <tasks> <msbuild> <buildArgs>msbuild-base.xml /m /p:BuildInParallel="true";Configuration="Release";Platform="Any CPU";nr="false";ccversionbase=15.1.0;NuGetProjectDir=D:\REPO\Repo-Base /verbosity:minimal /nologo /target:PreBuild</buildArgs> <dynamicValues /> <environment /> <executable>C:\Program Files...

Msbuild now to conditionally use one of two targets with same name

visual-studio,msbuild
I've seen some answers to a similar question but not exactly the same and not with positive luck trying to use suggested solutions... so I'm trying something like this: <project> <target name="foo" Condition="'$(Configuration)' == 'Debug' "> <Message Text="=== RUNNING FOO DEBUG TARGET ===" /> </target> <target name="foo" Condition="'$(Configuration)' == 'Release'...

LibGit2Sharp versioning error MSBuild

tfs,msbuild,tfsbuild,libgit2sharp
I'm getting the following error: Error 17 System.IO.FileLoadException: Could not load file or assembly 'LibGit2Sharp, Version=0.14.30212.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. A strongly-named assembly is required. (Exception from HRESULT: 0x80131044) File name: 'LibGit2Sharp, Version=0.14.30212.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' ---> System.IO.FileLoadException: A strongly-named assembly is required. (Exception from HRESULT: 0x80131044) I...

Binary files copied to a wrong folder on build

msbuild,appharbor,post-build-event,libgit2sharp
Recent libgit2sharp Nuget uses a new Nuget feature that allows you to include a piece of a build script in your NuGet. The purpose it to copy a native dll to a subfolder of the bin folder, like that: <ItemGroup> <None Include="$(MSBuildThisFileDirectory)\..\..\lib\net40\NativeBinaries\amd64\git2-e0902fb.dll"> <Link>NativeBinaries\amd64\git2-e0902fb.dll</Link> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> </None>... Now, it was all nice...

How do i have a .csproj build a .proj file before building itself?

c#,msbuild
I have a .csproj file and a .proj file. As part of my .proj file I am generating a file to include in the .csproj, so the .proj needs to run first. How can this be done. I originally tried to add a project reference as follows: <ProjectReference Include="..\FileGenerator\FileGenerator.proj"> <ReferenceOutputAssembly>false</ReferenceOutputAssembly>...

MSBuild Error: “The solution file has two projects named …”

visual-studio-2013,msbuild,publish-profiles
I'm trying to figure out how to make MSBuild work so I can set up automated builds and would appreciate some help with this weird error. I'm using Visual Studio 2013, and a Web Application project. The solution has 8 different class libraries. I've got several Publish Profiles set up...

Release Management for Visual Studio 2013 - Release Exception

visual-studio,tfs,msbuild,release-management,ms-release-management
Getting the following error after a successful MsBuild on a TFS Build Server: ERROR: Value cannot be null. Parameter name: The attribute 'BuildNumber' is not part of this XElement at Microsoft.TeamFoundation.Release.Common.ExtensionMethods.XmlExtensionMethods.GetAttributeValue(XElement element, XName attributeName) at Microsoft.TeamFoundation.Release.Data.Model.ReleaseComponent.SetBuildToLatest() at Microsoft.TeamFoundation.Release.Workflow.Services.ReleaseWorkflowService.InitiateFromBuild(Uri teamFoundationServerUrl, String...

Jenkins Cannot import the following key file

jenkins,msbuild,command-prompt,pfx
I am able to build my application on Visual Studio without any problem. I am trying Jenkins out on the same machine. When I try to build my application from my git remote repository (It contains the .pfx file in the SVC) I get the error error MSB3325: Cannot import...

Building a multi-arch installer with msbuild

c++,windows,msbuild,installer,nsis
I'm building a multi-architecture installer for a C++ program with NSIS. I'm using Visual Studio 2010. All is well except I don't know how to make the installer depend on the build for all architectures. I have created a project to run makensis as a build step, and configured it...

CodeContracts fails the build for seemingly no reason

c#,.net,msbuild,code-contracts
I have a C# PCL project that uses code contracts. However on TeamCity the project fails to build, but it looked like the build was successful locally. However the build log does claim that the build did fail, but it gives no reason at all. 'Fail build on warnings' is...

Intermittent BadImageFormatException building “plugin” DLL on PC or via TFS build

c#,msbuild,tfsbuild,msbuildcommunitytasks,badimageformatexception
I have an application where several of the assemblies are built separately from the main application. At run-time they live in a folder outside the main BIN folder and loaded by the main application using Assembly.LoadFrom. In the VS project for these "plugin" assemblies, there are references to physical assemblies...

MSBuild confusing behavior with Target Outputs & Returns

.net,build,msbuild,automation,build-system
I'm trying to understand the logic behind Outputs & Returns parameters. And I found very confusing behavior in case of using Outputs & Returns attribute. e.x. I created a project with 2 targets "Build" and "InternalTarget". The first target defines its output via Outputs attribute and the second defines output...

Tfs post-build step running application hangs

batch-file,tfs,msbuild,continuous-deployment,post-build-event
We have a configured TFS CI which is making our build. After a build I`d like to have my simple executable application to be deployed to specific folder on the server and then started. I decided to do this with post-build step and batch script. Everything works perfectly except one:...