Newest msbuild Questions

Q&A for professional and enthusiast programmers

How to disable compilation for Package target?

There is a some parameter which can disable compilation in Package target of MSBuild?

Team Services Build Artifacts

I'm attempting to create a build that will build my solution, apply web.config transforms as necessary and finally copy desired output (a built web api project) to the artifacts area of the build. I'...

VS build project error: The specified task executable “vbc.exe” could not be run. Access is denied

I am switching to Windows 10, and the project build gives this error: "The specified task executable "vbc.exe" could not be run. Access is denied" Running Visual Studio 2015, project type is class ...

How to include an header automaticaly in all cpp files in visual studio?

I would like to include an header in all cpp files of my project without to change all cpp files manualy in visual studio. Does someone can help me ? I need this feature cuz I will use Visual Leaks ...

What's the difference between Content and None when “Always copy to output directory” is set?

In csproj file, we can include a file using either None or Content element. From MSDN, it says that: None - The file is not included in the project output group and is not compiled in the build ...

Visual Studio 2017 MSBuild and netstandard1.5 and netstandard1.6 tasks

Does the new MSBuild version (15.1.458.808) support netstandard1.5 or netstandard1.6? I only can load custom tasks written in netstandard1.4. The other versions just throw a "Could not load file or ...

New SignTool Certificate and Password causes MSBuild/WiX postbuild events to fail

I have been using PostBuild events in my deployment solution in both my DLL project and my WiX project (used to build an MSI) successfully for the last 4 years. Recently, we received a new certificate ...

How to build .xproj before .csproj

This is a follow-up from this question. As I'm not able to directly reference my .xproj in my .csproj in Visual Studio, I am forced to directly reference the built net461 dll. So in this situation, I ...

How to extend or write new rules for sonarqube for MSBuild 12 and any solution items

We want to write custom rules on visual studio solution items (*.cs, *.ts, *.js, *.html) for SonarQube 6.1 analyzer reports for our continuous x(i,d,d). I looking for two days how to do it but ...

Visual Studio Online build step PackageLocation being ignored

I have a Visual Studio Online build definition that seems to be misbehaving, but I'm not sure if I've just misconfigured something. There is a build step which is configured as follows: Type: Visual ...

TFS “LC” task was not given a value for the required parameter

After adding MSBuild arguments: /tv:14.0 /p:VisualStudioVersion=1 I get the following error message: C:\Builds\10\IW_*****\Dev\src\Sites\******\Properties\CompileLicxFiles_Patched.targets (98): The "...

Signed Apk is not working on Xamarin Test Cloud

I have created an apk file using Bamboo on a mac machine using the following steps: I create the release apk file using a command task with the executable MSBuild like this: CustomerApp.Droid/...

How to fix output path in net core 1.1?

I have asp.net core 1.1 project. I opened it in vs 2017, I didnt have project.json file, only csproj, when I tried run my project I have error: The OutputPath property is not set for project 'Store....

How to use Microsoft.Web.Deployment to operate MsDeploy how to preview file changes

When I use the MsDeploy in the way of using Microsoft.Web.Deployment to meet a problem, my C# program can work normally, the use of contentPath providers will be the site of the normal file ...

Team Services Azure App Service Deploy failure - Virtual Application characters?

I have 2 Azure App Service Deploy steps in a Team Services build, they have the same Subscription details. The only difference is that they target different virtual applications - the one that fails ...

How can I use Dotnet Core 1.1 CLI tooling without a project.json?

I've built a web app in Visual Studio 2017 RC targetting Dotnet Core 1.1. As per here and elsewhere, MS have announced project.json is being retired and favoured for MSBUILD .csproj files. Problem is ...

Make MSBuild detect and extract errors and warnings of non-ms tools

When MSBuild build completes, the driver extracts warning and error messages and prints an error summary. However it only recognizes the error format it itself and Microsoft compilers use. But we also ...

MSBuild condition to prevent app.config XML transform

I am using the 'SlowCheetah' VS extension to transform our app.config with different values depending on the project configuration. So a 'Debug' configuration produces an app.config with values ...

Code signing cert disappearing for Microsoft Clickonce app

We have a clickonce app that is deployed on a schedule. The app uses a code signing cert that is in the personal store of the appbuilder account. The certificate is dropping out of the store at ...

How to make MSBuild Command Line ignore non ClickOnce applications during publishing?

In my Solution, I have three executables which two of them should not be distributed through ClickOnce and not have those files generated. They are internal console applications that are distributed ...

Continuously Deploy ASP.Net Core application using PowerShell script in TeamCity

I have a ASP.Net Core .xproj. I want to deploy the website continuously on to a server which is hosting the website using IIS. I have TeamCity installed on my server and able to deploy other .NET ...

“C:\Microsoft.Cpp.Default.props” was not found

I have a project created in Visual Studio, 2013. The project file has the following properties: ToolsVersion="12.0", PlatformToolset = v120. I have Visual Studio 2013 and Microsoft Build Tools ...

C#: copy dependency of dependency when building project

I have a C# project (e.g. Project.exe) which depends on a.dll, and a.dll depends on b.dll. When I build Project.exe, a.dll gets built and copied into the output folder for Project.exe - but b.dll ...

.Net build is failing due to invalid applicationHost.config

Folks, Am trying to run a build using the below command line however there is a prompt everytime which is causing trouble. I have to address this manually and cannot run automated builds. $...

TFS2015 vNext build fail:MSBUILD : error MSB4017: The build stopped unexpectedly because of an unexpected logger failure

TFS2015 vNext build fail with logger error (error message attached below). From my investigation, looks like this is related to CentralLogger - "Microsoft.TeamFoundation.DistributedTask.MSBuild....

How to configure proxy settings for one job (using nuget) in TeamCity

I have one job in teamcity which is using MSBuild: MSBuild Build file: build.xml Targets: Package I know it's possible to configure proxy settings for the whole teamcity server but I just want to ...

Encounters an error “ access to the path c:/users/local/application data is denied ” while running unit test in FAKE

I am trying to run unit test cases from fake , while i run the script , it throws an error , i.e. access to the path c:/users/local/application data is denied. Code : Target "Test" (fun _ -> !!...

How to programmatically determine the active solution build configuration using MSBuild libraries in Powershell

I'm in the process of writing a Powershell script that retrieves custom metadata from all the exe/dll projects in a particular C# solution. My efforts have centered around using the Microsoft....

UWP .appx file naming

I am building an UWP app and I want to have generated package to be named with the build number in order to distinguish the builds. So far, I have this configuration in the csproj file: <Target ...

How to build SSDT project on a “headless” build server?

I have Windows Server 2012 R2 which I want to use to build .sqlproj projects from SSDT in a CI pipeline. This is what I've done so far: Installed nuget commandline Installed nuget package Microsoft....

I need to build external C++ solutions from a C# project

I'm working on a program that looks for solution files in a directory and then builds any you select on specified configurations and platforms, but I'm struggling to get it working in C#. The ...

JetBrains Rider EAP on Linux - Solution load failed: MsBuild not found

Just installed the latest version of Rider EAP (163.12057) and tried to create a new solution. In my Solution Explorer its shows my Solution and (load failed). In the Event Log window I get the error ...

How I pack a multi-target package with MSBuild 15?

I am using the new MSBuild 15 distributed with VS2017 RC to compile and pack a multi targeting project. Restoring: msbuild /t:restore mysolution.sln works correctly. Building: msbuild /p:...

SonarQube - unable to write message error

We have just updated to TFS 2017 and I'm going through setting up SonarQube integration into pull requests for our builds. In the process I've come across an issue that I can't seem to figure out. ...

Signing a ClickOnce application with an AfterCompile target

I've been trying to wrap my mind around Authenticode certificates for a week now. I purchased a CSC from Comodo and I've got a ClickOnce application I'd like to sign so that the SmartScreen Filter ...

What are msbuild tasks and when and why would you choose to use them?

What are msbuild tasks and what situations should you be using them or not using them? What are the alternatives? What advantages or disadvantages do they offer?

Is there a way to benefit from the AST of the Roslyn C# compiler directly?

I'm wondering if it is possible to access the C# AST (Abstract Syntax Tree) used by the C# Compiler during a build directly? I know I can get the AST for a given project using the Roslyn API but that ...

How to build SCOM 2012 management pack using msbuild?

I have a Visual Studio project which I'm building with Visual Studio and everything works fine. When I'm trying to build it using msbuild.exe /t:Build F:\BuildSource\SCOMManagementPacks\2012\Packs.sln ...

FAKE vs CAKE , which one is better for .net applications ? [on hold]

As of now I am using MSbuild for building the solution . But I am asked to switch on FAKE , which is based on F# and I am a novice user on F# . While I am working on c# for a quite long time ...then ...

where does the log is created by default in FAKE F#Make?

I am trying to build a csproj file with FAKE, following the "Getting started with FAKE - F# Make" tutorial from the FAKE website. I am trying to understand what this line is doing: |> Log "...

WarningsPlugin not Collecting warnings from MSBuild

I am experimenting with a Multibranch job. Building the solution works, but parsing the warnings generated by the build fails. this is my Jenkinsfile: node { stage ('Checkout') { ...

Include my json file from .nupkg into project bin folder

I have a .json file within my project that is converted to a nuget .nupkg package. I want this .json file to be included in the project consuming the .nupkg bin folder. Currently, it is including it ...

How do I exclude a folder from a project but not from publish?

I've migrated an asp.net core project to VS2017 RC, which now supports the ability to exclude files from a project. I've excluded two folders, which added these lines to my csproj file: <ItemGroup&...

Conflict between two referenced assemblies

I'm playing with .Net Core application which is working fine. However, today I found that output contains a warning. After setting log level to detailed I found following: 2> Dependency "...

WiX Msi not creating a folder in install path when installed from a Bundle in Release Configuration

I have an Exe package created using WiX Toolset with 7 Msi's bundled inside. As per my requirement i create 7 folders in the Installation path. One folder for each Msi's. When i build my WiX ...

“Al.exe could not be found” when build 4.0 projects in MSBuild

I have a project developed in 4.0 framework and it is working fine when running with visual studio. But when i execute the same project with MSBuild in command prompt , the project not getting build ...

What's scatter files in .NET assembly

I'm compiling a .NET application and in diagnostic output of MSBuild I see mentions of scatter files (from referenced assembly). Searching for some information around interwebs brought nothing useful. ...

I can't web deploy because i get this error “The ”CheckRemoteFx45“ task could not be loaded from the assembly”

I keep getting this error when i try to web deploy: "The "CheckRemoteFx45" task could not be loaded from the assembly C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\Web\Microsoft....

Include pdb files into my nuget (nupkg) files

I am using MSBuild to generate my nuget packages. Is there any command I need to set, to allow it to include my .pdb files, for stepping into the source while debugging? I do not want the source ...

MSBuild is failing after Jenkins job is queued with ECONNREFUSED, url is not correct

I have been searching for the answer to this problem. We just set up TFS2017 in our development lab, and I am working on integrating the Release Management with our Jenkins build environment. I have ...
Translating... 0%