Questions tagged [msbuild]

1

votes
1

answer
1.4k

Views

Will MSBuild support .Net Core Projects

I've been researching for a while now. Unfortunately all sources I read are outdated. Anyone knows if MSBuild plans to support .Net Core Applicatoins? And is there a other Build Engine which Supports it?
1

votes
1

answer
340

Views

How to translate this MSBuild script to F#/FAKE?

What is the translation of the following MSBuild script into F#/FAKE? None My main goal is to set a property in the topmost targets with different values (CurrentMode is either A or B) and consume it in the deepest target (Compile).
mu88
1

votes
1

answer
117

Views

What's needed to have a .NET Framework project reference a .NET Standard assembly?

I have a project that's built against .NET Framework 4.6.2. One of its dependencies is an assembly built against .NET Standard 2.0. It was building just fine before, on my old computer, but now I have a new dev system I'm setting up, and when I try to run the build, with the same version of the sam...
Mason Wheeler
0

votes
0

answer
4

Views

Azure DevOps + LibMan + UNPKG Intermittent Error LIB010: Failed to download resource from unpkg.com

I've setup Continuous Integration on Azure DevOps but I keep getting an intermittent issue whereby libman fails to download a resource here's a few examples: ##[error]libman.json(0,0): Error LIB010: Failed to download resource from 'http://unpkg.com/[email protected]/dist/css/icons/dxiconsmaterial.w...
Smithy
0

votes
0

answer
3

Views

Best Practices for Transitive Package References in NuGet

I am relatively new to the new .NET project format, and was looking to solicit some opinions on how best to manage a library's dependencies. Let's say I am writing a library (intended to be shared as a NuGet package) which contains some ASP.NET core functionality. In my library's csproj file, I can...
AlexC
1

votes
1

answer
626

Views

MSBUILD: How to parse solution file to get project paths

How can I get the list of project files from a solution when using MSBUILD? For example getting all the .csproj from a .sln.
Schneider
1

votes
2

answer
194

Views

How can I specify the referenced multitarget project's platform?

If I have a multi target (netstandard16 and PCL Profile44) project (new SDK style csproj) and I reference this in a Xamarin.iOS/Android project as project reference, how can I specify the referenced platform? The Xamarin project pulls netstandard but I want to use the PCL in this case.
Tóth Tibor
1

votes
2

answer
1.5k

Views

Copy files from Nuget package to output directory with MsBuild in .csproj and dotnet pack command

Last time I had to find out how to extract some files from a Nuget package in took me at least 6 months but I finally managed to find the solution. The thing is that, this solution assumes I have a .nupkg file and manually add a .targets file to perform the extraction process. Now, things are differ...
Jérôme MEVEL
0

votes
0

answer
5

Views

.NET Core 2.1 version error with Cake Build 4.0 NuGetRestore and MSBuild actions

Cake Build 4.0.0 runs NuGetRestore and MSBuild methods by executes MSBuild CLI command. From my understanding, Cake downloads certain version of MSBuild. In my solution, it is mostly .NET Framework, but our testing project is targeting .NET Core 2.1 (we will eventually move our whole project to .NET...
Ross Gustafson
1

votes
0

answer
48

Views

Config transform not working on connection strings in unit test projects

I have a Visual Studio 2017 unit test project with the following App.config: I then add a transform file calling it App.Release.config: So I expect the value of SomeKey to be 'B' and the connection string to be 'ConnectionToDatabase2'. However when I build my test project in Release-configureation I...
Alexander Schmidt
1

votes
1

answer
295

Views

How to skip one project from multiple projects in one solution in vsts build definition, VSTS

I have a Web Application which consists of three projects under one solution. But, I want allow only two projects in Build definition to build through arguments in VSTS. Is it possible, If possible how I want to skip one project through command in Arguments?
Mani
1

votes
1

answer
300

Views

Xamarin / iOs / MSBuild: random build crash with “The Build Agent is not running on the Mac”

We’ve recently upgraded our local Windows CI server building our Xamarin solution to the latest VS2017. Before it was still using VS2015. Since that time, about 30% of our build fails randomly with the following error: C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\Xamari...
Alexandre Defalque
1

votes
0

answer
80

Views

Make MSBuild output file visible

There's a way to make the output file from MSBuild become visible in project tree (Solution Explorer)? True True
Fabricio Godoy
1

votes
0

answer
241

Views

Cake, VS2017, .NET Core 2.0 and building SQL project

I'm trying to build a .NET Core 2.0 solution which has got a blank empty SQL Server project but getting this error: MyDb.sqlproj(57,3): error MSB4019: The imported project 'C:\Program Files\dotnet\sdk\2.1.4\Microsoft\VisualStudio\v11.0\SSDT\Microsoft.Data.Tools.Schema.SqlTasks. targets' was not foun...
Ambuj
1

votes
1

answer
80

Views

Where to specify the /doc switch in Visual Studio 2017

To generate an XML documentation file I need to add the /doc or -doc switch to the build options. I cannot work out where to add this. I am using (an updated this morning) Visual Studio 17 Community Edition. The Solution is slightly older, 2015, as you can see in the file pasted below. Below are...
Hecatonchires
1

votes
0

answer
190

Views

Property is not defined .props

I am trying to get shared property like in this tutorial from .prop file, but running msbuild propsTests2.sln is giving error: C:\...\propsTests2.csproj(8,58): error MSB4066: The attribute 'Version' in element is unrecognized. My files: .csproj Exe netcoreapp2.0 common.props 2.0.0 file common.pro...
Reven
1

votes
0

answer
39

Views

Setting an MSBuild property to a file version

I'm installing a toolset and I use the $(Registry:[email protected]) syntax to read the path to the compiler executable and set a property containing this value. However, in order to properly set up the search paths that the executable needs, I need to read the file version of this executable. I've seen...
Zachary Turner
1

votes
1

answer
319

Views

MSBuild to apply a nuget package to a project at build time

I have a cmake project that builds fine on Linux and that I want to build also on Windows. The code is portable and is made of C++ so... it should build. The only thing is that, on Windows, I need to use nuget to restore some packages, cpprestsdk is one of them. Now when I run cmake . CMake will g...
Herve Mutombo
1

votes
1

answer
1.3k

Views

The type or namespace name ' ' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?)

I am getting below error during tfs build. The type or namespace name 'Practices' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?) Though its working good on a specific tfs agent (another one). Here my requirement is not to use that TFS agent. Can anyone suggest,...
andie
1

votes
1

answer
136

Views

MSBuild PropertyGroup operates properly unless it is pulled in as a NuGet props file

I created a NETStandard 2.0 project. The tooling support around generating a NuGet package works fine; I can set the Version, Description, etc. What I wanted to do was to extend my project to support a way to generate prerelease versions automatically as well. The solution I came up with was the fol...
m-y
1

votes
0

answer
282

Views

Asset.car and app icons missing in ipa that was built with msbuild

We have a Xamarin iOS app. After migrating the app icons from Info.plist to asset catalog as described here we built the ipa on our Jenkins build node using msbuild. During the upload to iTunes Connect with fastlane deliver we get the following errors: ERROR ITMS-90032: 'Invalid Image Path - No ima...
Christopher Stephan
1

votes
1

answer
62

Views

Teamcity not excluding folder

I am using Teamcity version 2017.2 (build 50574) I am trying to create a zip archive artifact after successful build of my WPF app to be deployed using ClickOnce However, teamcity is not excluding the folder and I still see it in the zip Here are rules in my artifact paths section of teamcity: //put...
Aman B
1

votes
1

answer
381

Views

Error when trying to install firebase-admin via npm

I'm getting an error when I try to install firebase-admin: gyp ERR! build error gyp ERR! stack Error: `C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe` failed with exit code: 1 gyp ERR! stack at ChildProcess.onExit (C:\Users\TOYANSK\AppData\Roaming\npm\node_modules\npm\node_modules\node- gyp...
Atoyansk
1

votes
2

answer
141

Views

Can't package Service Fabric application in Linux environment

I need to package my Service Fabric application in order to deploy it to the Azure Service Fabric cluster. There is no any error when I use this command in Windows: dotnet msbuild SfTestApp/SfTestApp.sfproj /t:Package But when I push my source code to Bitbucket and try to package my application at p...
Yurii Pelekh
1

votes
1

answer
108

Views

How to pack a UWP library using PackageReference?

I'm working on a UWP library (this one) and I've just upgraded the target version to the 16299 SDK. This also caused the NuGet references to be migrated from the project.json file to the .csproj file as PackageReference, which in theory sounds perfectly fine. But, after trying to publish a beta vers...
Sergio0694
1

votes
1

answer
184

Views

TypeScript.MSBuild Error: Failed to create URI from *.js & .map.js

I've added the TypeScript.MSBuild NuGet package to two separate projects. (Tested just now with version 2.7.2.) Locally, it runs fine. On Kudu, it builds fine. However, on travis-ci and Bitbucket's pipelines, I receive the following error for each .ts file: CompileTypeScriptWithTSConfig: /home/tra...
LiHRaM
1

votes
0

answer
78

Views

Unable to force msbuild to disable TreatWarningAsError

I'm building a some project chain. For normal coding I set in each project TreatWarningAsError to true. But now I want to prepare code analysis and I want to disable this setting to be able to display all warnings form all projects. msbuild smth.proj /t:SomeTarget /p:RunCodeAnalysis=true /p:Treat...
senfen
1

votes
1

answer
86

Views

Exclude projects from solution build programmatically

I created an app to build projects from a solution using the BuildManager class. I am trying to exclude test projects within my solution. Is there a way in C# code to exclude projects matching specific names? e.g. *.test.proj Here is my code so far: public bool Build() { Dictionary globalProperty =...
James Andrew Smith
1

votes
0

answer
91

Views

pubxml custom file copy if not exists

I have added a section to my publish profile that copies the contents of an external folder to the bin folder. The contents of the folder are two dll's that are included so that we can use spatial functions. The issue I am having is that the DLL's are getting locked by IIS. The publish profile is ex...
user2623955
1

votes
0

answer
161

Views

How to run only the CompileTypeScript target in a .csproj with MSBuild exe?

Context I have standard .csproj and an imported standard typescript compile target in it. Nothing custom, all created by VS 2017, and the 2.7.2 version TypeScript tooling extension (and/or the nuget package?) for VS. When I run MsBuild against the default target (no /t: switch) all works and among t...
g.pickardou
1

votes
0

answer
57

Views

MSBuild Task CreateItem with files that exist

In a msbuild target, I am trying to create an item and it should include a list of files, only if they exist. All the variables shown are defined. Does anyone know how to add a condition for the file existence? I tried the one above and it doesn't work for me. Or is there another way to do this?
dushyantp
1

votes
2

answer
428

Views

Dependent builds in VSTS

I have a VSTS GIT repository, all UI, services, code is in the same repository. Successful build produces the installer (.msi) to install the application. Over the period of time my repository has grown up with lot of code. For each small code change & new build get trigger (gated check-in). Curren...
Atul Sureka
1

votes
0

answer
241

Views

Analyzing with SonarQube Scanner for MSBuild on Windows 10

Two weeks ago I was able to run and analyse .net projects on windows 10 but after some times, it stopped. I am getting this app can't run on your PC , To find the version for your PC, Check with the software publisher. I was following this url Scanning using Ms Build I have also changed my local sec...
Jack M
1

votes
2

answer
595

Views

Nuget Update Packages.config in MSBuild BeforeBuild Step

I have been trying to write an MsBuild task to automatically get Nuget packages from a feed url and automatically update the packages.config to update to the latest version. // ---- Download and install a package at a desired path ---- var sourceUri = new Uri('FEED URL'); // ---- Update the ‘packa...
TimMarsh
1

votes
1

answer
73

Views

The “MSBuild.ExtensionPack .Xml.XmlFile” task was not found

I am new in MSbuild when i tried to build the project using Command Prompt I got the below error error MSB4036: The 'MSBuild.ExtensionPack.Xml.XmlFile' task was not found. Check the following: 1.) The name of the task in the project file is the same as the name of the task class. 2.) The task class...
1

votes
1

answer
301

Views

Building a library targeting different versions of .NET

I have a library that I used to build against different versions of .NET by executing a command line like this: msbuild x.csproj /p:TargetFrameworkVersion=v4.6.2 ... multiple times with different value for the property TargetFrameworkVersion. Now I wanted to add .NET 4.7.1 to the script. The build f...
Valo
1

votes
1

answer
606

Views

How to deploy website using visual publish profile and Cake script

I would like to use Cake script to automate my build and publish process. I started some tests with local publish but I was unable to make my Cake script to use publish profile that I've created in Visual Studio. Is it possible at all? Here is my publish profile file: FileSystem Debug Any CPU True F...
1

votes
1

answer
165

Views

How do I set AssemblyVersion with * for auto build number in MBUILD 15?

I still want to let my new csproj generate the version number for my library with the new msbuild. But how do I allow the old msbuild behavior of filling in a random build number with an asterix * placeholder?
jbtule
1

votes
1

answer
87

Views

Target for new language on top of Microsoft.Common.CurrentVersion.targets

I'm writing a simple extension to allow MSBuild to compile solidity source files. My goal is when my solidproj gets compiled it runs specific executable which produces several bin and abi files that should be copied to the target directory. That sounds easy, however in practice it isn't. I currently...
Alex Zhukovskiy
1

votes
0

answer
745

Views

VS2017 Found Conflicts between different versions of “System.Runtime” that could not be resolved

I had a Visual Studio 2015 solution with 3 projects and then started using VS 2017 adding 2 new xunit projects. When I build everything succeeds but the tests are being discovered in Test Explorer. I reviewed this question Found conflicts between different versions of the same dependent assembly tha...
vfrank66

View additional questions