Newest msbuild Questions

Q&A for professional and enthusiast programmers

Implicitly run Unit Tests

Please see the DOS command below: C:\Windows\Microsoft.NET\Framework64\v4.0.30319\msbuild.exe WindowsFormsApplication1.csproj /t:Test The .csproj file looks like this: <PropertyGroup> ...

Visual Studio 2017 Code Style “Errors” do not prevent build?

I've set various C# Code Style rules to generate errors, and while violations show up as errors in the IDE (both in the error list and the text editor), actual builds still succeed. Can anyone ...

IDE Rider DotnetCore project.Json to .csproj dont load

After upgrading dotnetcore from project .json to .csproj, I have loading error in Rider IDE in solution explorer. This problem does not exist in other IDEs. os: Ubuntu 16.4, dotnetcore: 1.1.1, dotnet ...

Showing errors from a build-time tool with source file/line

My project has an MSBuild target which runs a tool which generated some files: <Exec Command="$(MyTool) @(Content)" ConsoleToMSBuild="true" IgnoreExitCode="False" ...

New TFS 2015 Web based build definition is not cleaning artifact from previous build even after sepcify clean

Building a solution with new web based build definition. passing MSBuild arguments during the build. checked clean options. but TFS is not removing old build artifacts from previous build, instead of ...

How to get access to the Microsoft Fakes tool regardless of the current Visual Studio version?

In Visual Studio, when you right click a reference, you can "Add Fakes Assembly", which kicks off a process that generates the *.Fakes.dll assembly. When I looked into it, it seems that it utilizes ...

ITask Fails To Load during .Net Core Project Build Process

I have a fairly simple class the inherits from ITask, and runs as a build task for updating versions (VersionUpdater.dll). The project file entry is as follows: <UsingTask TaskName="VersionUpdater"...

Copy dll modified in post-build to obj folder

Is there a way to get a dll updated in a post-build-event copied into the /obj folder? Modifying the dll (to embed some generated files) in the post-build works fine, but after a ReBuild, the /obj ...

Console App not working when called in powershell script using Msbuilds

I am using MsBuilds to run a powershell script that further calls a console application.When running the build, the powershell script runs but does not further call the console application, neither ...

How to make .NET Core MSBuild to not generate an empty assembly for a metapackage project

I have a .NET Core meta-package project defined in project.json. It contains no code but just references to a few other sub-projects. This meta-package project exists for 2 purposes: A NuGet meta-...

SonarQube scanner for MSBuild: end MSBuild integration failed

I'm having issues trying to execute the SonarQube Scanner. The begin part seems to run without issues, and also the MSBuild command, but the end part fails. 1st step: I execute the following ...

can't build xamarin android project

I installed visual studio 2017 community on my new computer from scratch. I can build all my other projects and solutions. But when I try build my android app, I always get this error message: The ...

error MSB4019 - MSBUILD looking for imports for non-existing version

When I try to build my SSDT project with MSBUILD, I get the following error error MSB4019: The imported project "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\SSDT\Microsoft.Data....

Does vscode have a csproj generator?

I am using Visual Studio Code because it is more lightweight than Visual Studio but still gives me the intellisense. However I could not find a way for Code to build a .csproj or .sln automatically, ...

How to make MSBuild15 to restore all projects in the folders other than 'src, test'

I'm trying to restore packages for ASP.NET Core project using dotnet msbuild command. I know dotnet msbuild command is just an alias for MSBuild(v15), but I think dotnet CLI is proper than using ...

TeamCity - 10.0.5 no compatible build agents

I'm wondering if someone could help me out with this issue please. First up the background, we've been using TeamCity for database deployments for a while. Today we upgraded to 10.0.5. All fine. The ...

TFS Continuous Integration and Deplyment

I have an web project Project A and a library Project B. Project B is being built into Project A\Plugins. The Problem is when Project A is being built via CI Project B isn't deployed with Project A. ...

VS 2017 Add > Docker Support breaks build - “CleanWorkspace” task failed unexpectedly (console app)

First off I'm using .NET 4.6.1. Does Docker with VS 2017 not work with anything but .NET Core? I used the new feature Add > Docker Support from the context menu, and it created a bunch of files. ...

How to copy files to ouptut directory from a referenced NuGet package in .NET Core csproj?

I'm trying to use PhantomJS NuGet package in .NET core csproj application. But I think it is not possible using new PackageReference syntax for NuGet. When I reference the PhantomJS package like ...

How to insert code quality metric - FAKE F#MAKE

I am trying to migrate existing MSBuild file to FAKE . I am trying to understand a piece of code but could not find how it is used , and how to implement this in FAKE.And the developer who worked on ...

Invoke MsBuild from custom task without inheriting properties and ItemGroups

The Build framework I'm working on provides a number of default steps so that the user only needs to provide configuration files describing their build process. The framework will then invoke the ...

What is the difference between MSBuild and F#'s FAKE?

I'm new to the .NET ecosystem and am jumping in with F#, coming from Java-land. I'm trying to wrap my head around the tooling and build process. My understanding is that MSBuild is the build tool ...

Setting value for a property MSBuild

How to set a property based in whether value for a parameter is available (from Jenkin's job) or not. If available, I need to use that value, else a default value in MSBuild. Thanks...

How do I include a text file alongside my class library in my NuGet package which Visual Studio 2017 is creating for me?

My text file is in my class library project. I have its Build Action set to Content and Copy to Output Directory set to Copy if newer, so the .csproj has a section like: <ItemGroup> <...

Where can I specify VSToolsPath?

I have the following definition in my .csproj: <Import Project="$(VSToolsPath)\WebApplications\Microsoft.WebApplication.targets" Condition="'$(VSToolsPath)' != ''" /> It turns into "C:\...

MSBuild fails due to missing files - that I actually want to exclude

I'm attempting to set up a Continuous Integration process for a legacy VB.Net ASP.Net Forms application, using Visual Studio 2015 and an on premises TFS 2013 server. However, I'm struggling to get a ...

Build separately a web app backend in a Xamarin solution using VSTS

Got a Xamarin solution which includes a project for a web app backend. Trying to set up a separate build definition for the web app backend so that it deploys to Azure app service. We have that API ...

How to check if directory exist in post build action of msbuild

I've migrated a project from VS2015 to VS2017 and I've noticed that sometimes building a solution that has a postbuild step it fails on the mkdir if the directory currently exists. Both VS runs as ...

Msbuild not using specified toolset for Visual C++ project

I have a machine with side-by-side VS2015 and VS2013 installed, and am trying to get something built using the VS2013 toolset (v120). However inspite of an explicit override in the project file, it is ...

TFS 2017.1 failing Complete the SonarQube analysis

On this test machine I have installed: VS17 Enterprise TFS17.1 SonarQube 6.3 SonarQube Scanner for MSBuild 2.2 Msbuild /version Microsoft (R) Build Engine version 15.1.548.43366 Copyright (C) ...

ASP.NET MVC project with a section written in Angular2: a build error occurs when using MvcBuildViews

Ok it could be a singular combination... INTRODUCTION I have an existing ASP.NET MVC 5 project. It contains a private "Admin" area. I'm planning to change this area migrating it to Angular2 (+ ...

Including a dependent assembly into a NuGet package in VS2017

I have a solution with 2 projects (NET Core). The first project (library) contains the main assembly, the other project (library) contains an assembly with resources, interfaces and other stuff. The ...

What's proper way to DLLs to Visual studio project?

What's the correct way to add DDLs to Visual studio C++ project so that the DLL would be copied to (OutDir)? My goal is to make sure that the DLL in OutDir is always identical to the source DLL, e.g. ...

TFS 2017 Build Automatically kicks off and keeps failing

I have a TFS 2017 server build, it is linked to a bit bucket\Git repo. The build is set to automatically kickoff when master changes. This works fine and also works fine if i manually kick off a ...

Xamarin project doesn't build in MSBuild unless “pre-built” in Xamarin

I have a Xamarin.Android project that throws "This package is unresolved" errors for all dependencies when attempting to build with MSBuild. Interestingly, if I try building it in Xamarin first and ...

How to exclude assembly from NuGet package when packing csproj?

I want to use "dotnet pack" to produce a nuget package, but I don't want to include the assembly file. My project doesn't have code, yet calling "dotnet pack" creates a package with an empty assembly ...

Published ClickOnce app deploying .exe

I am using MSBuild to publish a WPF click once app. I am calling something to the effect: msbuild /t:publish /p:PublishDir=[some directory] /p:ApplicationVersion=1.2.3.4 The output is including the ...

File locked even if site down

From time to time i get file in use error when trying to build.. and respectively publish - even with app_offline handler or site turned off. So i have to find the reason why IIS locks files. I have ...

Error : The OutputPath property is not set for project 'Project.Web.csproj'

Building my Jenkins/MSBuild solution gives me this error Build started 18-03-2017 14:38:15. Project "C:\Program Files (x86)\Jenkins\workspace\Development\Project.Web\Project.Web.csproj" on node 1 (...

Visual Studio 2017 csproj .NET Core build - views not being copied correctly

I have a project running in .NET Core and I am using VS2017 as IDE. When I build my project through Visual Studio 2017 it does not automatically add the Views folder and the wwwroot folder to the ...

msbuild fails the first time, then it works

My deployment script fails every time I run it for the first time. And it works every time I call it again right after. So, to deploy, I am running the script twice and it works but this shouldn't ...

Get UWP Package.appxmanifest version in MSBuild

I need the Package.appxmanifest Version in a MSBuild.Target. What I do is: <Target Name="Zip"> <ItemGroup> <BinDirectoryFiles Include="...\AppPackages\My-App_$(Version)\**\*.*" /&...

Sign Android Mono app with a keystore that has signature algo SHA1withDSA

I am using msbuild tool to build an app that is developed using Mono framework. I have a keystore file which is signed with SHA1withDSA. I want to sign the app(s) with this keystore. When trying to do ...

Opening a solution with msbuildworkspace gives diagnostics errors without details

I am trying to analyse a solution with Roslyn, with MSBuildWorkspace. The solution is a new solution, with 2 class library projects in them, one referencing the other. They are created in Visual ...

How to Build a Visual Studio 2017 VSIX using MSBuild

I'm trying to use MSBuild.exe to build my Visual Studio 2017 based VSIX. I can't just build the solution as I don't want to build other projects in there. I tried using variations of the following ...

Msbuild Reference not found

I want to bild an solution with msbuild tools but i receive this error Infrastructure\Core\CoreViewModel\ShellViewModel.cs(13,18): error CS0012: Der Typ 'System.Object' Infrastructure\Core\...

MSBuild cannot build a solution when Visual Studio works

I tried to add CI support in my little github repository, so I configured it to use appveyor. But it was unable to build my solution and was failing with odd errors. But it had a build log, so I ...

MSBuild copy or create file if not exists

I have a simple requirement to create a file in the project directory called user.config, but only if it doesn't exist already. First attempt: <Target Name="BeforeBuild"> <ItemGroup&...

BundlerMinifierCore files are not copied on dotnet publish

I had an ASP.NET Core 1.1 application, which was upgraded from Visual Studio 2015 using project.json to Visual Studio 2017 with the MsBuild csproj standard. The app is deployed to a docker container ...

Hybrid DotNet Core/.NET Framework Build with MSBuild

dotnet msbuild from the sln directory works C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\MSBuild.exe from the solution directory works I don't want VS 2017 to ...
Translating... 0%