Newest msbuild Questions

Q&A for professional and enthusiast programmers

Wix 3.5 Product.Generated error using TFS 2015 VNext Build

In our project, we are migrating TFS from 2010 to TFS 2015. We are creating builds using vNext build. Earlier the builds were written in XAML. The situation is - existing XAML build working in TFS2010 ...

How do I set the OutputDirectory for msbuild pack?

Previously using 'nuget', one could run 'nuget pack -OutputDirectory ../../output' for example. How can I do this with msbuild pack? I am using VS2017.

Best method to automate .net mvc web deployment using jenkins [closed]

I'm trying to automate web deployment of our .net mvc project using jenkins .Which is best practice to do so

Visual Studio 2015 - ClickOnce Build and Deployment

myApplication.application file placement... How do I control the placement of this file for deployment? When I publish from Visual Studio GUI, the VS GUI nests the .application file with the rest of ...

Debugging Delphi programs with GDB

My goal is to use VS Code for developing Delphi application and I can already build Delphi projects (.dproj) and group projects (.groupproj) with debug information. But I use RAD Studio\9.0 for ...

dotnet core publish: include/exclude dir in output

Given aspnet project with folders: / /sql /WebApp /Client /wwwroot /Views On project.json I used "publishOptions": { "include": [ "..\\sql", "wwwroot", "Views",...

pass global options such as /Zm through msbuild (14.0)

How can I pass the annoying /Zm500 (500% virtual memory, because MS compiler is to stupid and even 32bit) through "msbuild.exe" such that when compiling a solution with it uses this option for every "...

Does TFS 2015 Team Buider that uses MSBuild order building of projects properly according to dependencies stored in solution file?

My solution consists from C# projects. I need one build definition that builds the whole solution. Most of projects have project to project referencies (like ProjectReference Include=) but some ...

PostSharp Error With Express Edition

I'm seeing errors using PostSharp Express (PostSharp30 target) -> Core.csproj : postsharp error PS0127: The assembly 'ModuleDeclaration Utilities.dll' uses non-licensed features ( Basic Features)...

How to get the current operating system in MSBuild?

I have a .NET Core 1.1 console project created with Visual Studio 2017. After building the project, I need to run a powershell script so I added the following to the MyProject.csproj file: <Target ...

Is there any way to prevent transfer a package from A layer to B layer?

I'm Using .netstandard 1.4 in Xamarin.Forms. For example I'm using Microsoft.AspNetCore.Identity.EntityFrameworkCore in A layer. Because A layer referenced from B layer and B Layer referenced from ...

Edit the msdeploy generated deploy.cmd file

The {project}.deploy.cmd file contains commands to be executed by msdeploy. This auto generated file contains a line that echoes the command that is being executed: Start executing msdeploy.exe ----...

Automatically Compressing Published Files Into a .ZIP File

I am currently using Teamcity to automatically build and publish our solution to a directory specified in the system.PublishProfile property (i.e. C:\Deployment Files). Is it possible that after ...

Creating build and publish script for .net Application using powershell

I am new to power shell, I am trying to write a power shell script to build and publish the c#/.net application(Web). I have tried below code to generate build- $projectFileAbsPath = .csproj path $...

TFS (CI) - Only one branch has just been check-in/pushed to be built

I'm trying to deploy a Continuous Integration server where I work. We used TFVC with the branch to release strategy, but we are having difficulty with something that should be trivial. We only need ...

TFS 2015:No agent could be found with the following capabilities: msbuild, visualstudio, vstest

We have recently upgraded to TFS 2015 Update 4. When i tried to do a build, I am getting the following error "There are issues with the request or definition that may prevent the build from running:...

Writing tasks using dotnet cli

My .net core application is getting amazing, and all the bros want to use it. I need to give them a fail safe way to get the project running, as well as a strategy for adding publish tasks down the ...

MSBuild deploy only - no build

Is there anyway to do the publish/deploy part of a /p:DeployOnBuild=true call to MSBuild? For instance, doing the build in one call, then the publish (file copy) in another call. There is an issue ...

Is there a way to fail compilation if an access modifier is not specified?

Is there any way to configure a solution to fail compilation if an object does not specify an access modifier?

MSbuild.exe not adding correct dependency for UWP app targeting .Net Native 1.6

I have a blank UWP app in which I have referred "Microsoft.NETCore.UniversalWindowsPlatform": "5.3.2" Now I expect that after nuget restore and MSbuild I should get these in "Dependencies" folder of ...

xunit from TFS2015 - where to put ParallelizeAssemblies

I'm trying to speed up our unit tests. By setting xunit.parallelizeAssembly to true in in the app.config files I get multiple tests from different assemblies to run in parallel when run from Visual ...

Is there any MsBuild property $(???) for Unit Test executions?

I am trying to assign a condition to a "Target", With the intention of evaluating whether the compilation is produced by the test run or not img Run All Tests img Singel Test But, I do not know ...

MSBuild Content Include Link if not exists

visual studio 2017 aspnetcore csproj here. I have this: <Content Include="..\..\..\..\somepath\app\js\**\*.*" > <Link>app\js\%(RecursiveDir)%(FileName)%(Extension)</Link> </...

Build multi-target project and get list of output dlls

What I would like to achieve: I have a list of project files (.csproj) and I would like to build them but also get the list of dlls it generates <MSBuild Targets="Build" Projects="@(...

$(SolutionDir) and $(SolutionPath) are not working properly in Visual Studio 2017

I am trying to use $(SolutionDir) or $(SolutionPath) in some .csproj file in Visual Studio 2017, but $(SolutionDir) returns empty string and $(SolutionPath) gives me the current project directory. I ...

Web Api built with msbuild does not work due to Microsoft.DiaSymReader.Native assemblies

I recently started running into an issue when building my web api project using MSBuild on VSTS and I managed to reproduce it locally. My Web Api is a standard, run of the mill api with nothing fancy ...

How to build the Python Project(Visual studio) using Teamcity?

I have developed python project using visual studio. but teamcity does not build the solution. Is there any chance to build the python project to Continuous integartion (Teamcity) ?

msbuild builderror for .net standard library

I'm using Visual Studio 2017 Community on a Windows 10 box. When I add a .net standard library (just the default code) to my solution the solution builds just fine in Visual studio 2017. But when I ...

To make Jenkins job download code from GIT faster

I am working on Building .NET Application with Jenkins using MSBuild. As part of build process, first step we are downloading the code from GIT which is Appx. 2GB of data(sourcecode files along with ...

Processor architecture mismatch between projects when building C# MVC 5 site

The error I'm getting is as below... build 20-Apr-2017 13:23:38 C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(1605,5): warning MSB3270: There was a mismatch between ...

How to get the base path of system-wide .NET Core runtime environment?

when I run dotnet --version, among other information I receive also: Runtime Environment: ... Base Path: C:\Program Files\dotnet\sdk\1.0.0 Is there any way to get this value programatically in C#...

Download and import MSBuild target with NuGet in one step

I'm using MSBuild.Extension.Pack in an MSBuild project file but would like it to automatically download the pack (using nuget) first if it's missing. This is so the user can just run msbuild and it ...

Target framework in output file name from C# when using multi targets

When I compile a C# application, the filename of the output is ProjectName.dll. But how do I do if I want the filename to be ProjectName.net46.dll? Edit I want that the outputs to be ProjectName....

MSBuild: How to Future-Proof Import Project Path?

A similar question was asked a few years ago, but I'm wondering if anything has changed in the interim or if folks have new ideas how to do this. I've imported MSBuildTasks (MSBuild Community Tasks) ...

How to build multi-target solution on .NET Core?

I have solution with multi-targeted csproj files: <PropertyGroup> <TargetFrameworks>net45;netstandard1.6</TargetFrameworks> </PropertyGroup> or <PropertyGroup> &...

What is the order that every builds when running Microsoft Unit Test Framework?

Here's the scoop: I have a simple test class: [TestClass] public class TestClass { [TestMethod] [DataSource("System.Data.SqlClient", DATA_CONN, "myData", DataAccessMethod.Sequential)] ...

How to use BuildManager to build .Net Core project or solution on Visual Studio 2017 (MsBuild 15)

I want to build a simple project or solution (VS 2017, .NET Standard/.Net Core): ProjectCollection pc = new ProjectCollection(); pc.DefaultToolsVersion = "15.0"; ILogger logger = new ...

What are the specific version numbers of the C# 4, 5 and 6 compilers and how to know which one Visual Studio is using to compile my project?

I know that I've got the C# 6 compiler and I use C# 6 features often and when I write applications to practice, I usually target .NET v4.6. On this machine, I have Visual Studio 2010, 2013, 2015 and ...

How to translate JS tests with Babel before running in R# test runner?

We want to write our JS specs in ES6 and translate them using Babel before running in the ReSharper test runner. Currently, we're running the tests in Chrome (willing to use headless or PhantomJS if ...

Getting referenced types from MSBuild

I want to implement VS' "Find all references" feature, but extended outside the solution. To do this I need to populate a global reference table with classes, functions, variables etc. My plan is to ...

Using Visual Stuidio Build Getting Error “MSB4006: There is a circular dependency in the target dependency graph involving target ”Build“.”

We are trying get tfs 2017 to automate a build, thus far we have always just used visual studio to build and published but now having tfs do it we are running into an issue with circular dependencies. ...

c++/cli ZmFactor /Zm asked to be less than 100 with errors C3859 and C1076

I am building solution that contains c++/cli projects than include many hpp files so building with Visual Studio 2013 requires ZmFactor more than 409 so all the projects contain /Zm500. So it works ...

How to set outputpath-attribute in Visual Studio 2017 project without target framework cluttering the resolved path?

Setting outputpath in the new Visual Studio 2017 project format automatically adds the target framework in the output path. For example if I have these set in the project file: <TargetFramework>...

Create multiplatform Nuget from same project files

I want to create a Nuget package with multiple assemblies that are both .NET 4.5 and .NET Standard. Some consumers of the package are still on VS2012, so I can't just make a .NET Standard package. ...

Visual Studio $(ProjectDir) is empty string

I am using Visual Studio 2017 and I want to add a post-build command. when I go to 'Macros' window I see the correct path coresponging to $(ProjectDir) variable. So I added the command: $(...

Roslyn - determine project excluded from build configuration

I am trying to figure out which project is enabled/disabled in respective build configuration/platform setup. Where could I find this "project.BuildsInCurrentConfiguration" information please? var ...

String interpolation error when building with NAnt and MSBuild

Having the following NAnt build file: <project name="whatev"> <property name="MSBuildPath" value="[...]\Framework\v4.0.30319\MSBuild.exe"/> <target name="build"> <...

MsBuild only outputs first error

I am running msbuild through Visual Studio using BuildRequestData, BuildParameters, and BuildResults. I am then storing the output of the test and using File.WriteAllLines to output the data to a ....

FileSystem Deploy error - unable to create directory, access is denied

I am using TFS build process with the following MSBuild arguments: /p:DeployOnBuild=True /p:PublishProfile=Development The publish profile works when run from my machine in VS, but when it is run ...

Referencing nuget packages from nuget package

I have a nuget package which depends on several other ones (e.g. Newtonsoft.Json). Package is not intended to use as a class library it only adds custom MSBuild action so the structure of the package ...
Translating... 0%