Questions tagged [msbuild]

Microsoft Build Engine, also known as MSBuild, is a build platform for managed code and was part of .NET Framework.

msbuild
Filter by
Sorted by
Tagged with
0 votes
0 answers
38 views

How to pass complex arguments to msbuild in bash?

If I run this in Powershell it works: dotnet test /p:CollectCoverage="true" /p:CoverletOutputFormat="lcov" /p:Exclude="[*]System.Text.RegularExpressions.Generated.*" ...
Daniel Robinson's user avatar
1 vote
1 answer
84 views

Referencing a C# parameter name in an attribute, working on Windows, not on Linux

I am having an issue when running a pipeline to build for a .Net 6 Web API project. I have code that looks like this: [HttpGet] [MyAttribute(nameof(parameterName))] public async Task<IActionResult&...
SBFrancies's user avatar
  • 4,130
0 votes
0 answers
85 views

How to use MSBuild for Visual Studio 2008 in a docker container?

I want to create a docker container that can build solutions using MSBuild for Visual Studio 2008. I have already installed the .NET Framework 3.5 and .NET 3.5 SP1 on the image. However, when I try to ...
Bernoulli Lizard's user avatar
0 votes
1 answer
235 views

Trying to use ProjectReference to publish app as self-contained for use in WiX v4 project

I'm trying to create installed with WiX v4 that would publish another C# project, harvest its files, and then package those into the installer. I was able to get that to work, but the issue is that ...
Thomas Coleman's user avatar
0 votes
0 answers
26 views

MSBuild: Finding my nuget.config if it is not next to the sln

I'm developing a Visual Studio Extension (vsix). The problem is related to MSBuild, NuGet, and PackageReference. Context: My VSIX has a ProjectTemplate capable of creating new C# projects with some ...
Baner22's user avatar
1 vote
1 answer
90 views

Running processes at the same time on the Target xml object (csproj file)

I was thinking how I could run multiples processes (setting up the dependencies to achieve the final result) in a just dotnet custom command. I quickly found the target xml object that I can setup in ...
Nuno Domingues's user avatar
-1 votes
1 answer
58 views

Cannot call functions in a DLL [duplicate]

So I want to make a shared library, and testing how it works... But I just don't understand what am I doing wrong here... main.cpp: //main.cpp #include <iostream> __declspec(dllimport) int foo(...
Allay466's user avatar
0 votes
0 answers
21 views

Handlebars.Net.Helpers in MSbuild project with no cs

I did some extensive research but I couldn't find similar problem. I drop in some project which is based on MSbuild it only have csproj file and bunch of handlebars templates that are created during ...
Goran Udovicic's user avatar
0 votes
0 answers
214 views

Where is the location of cl.exe of VS2015 msvc build tool (v140) in VS2022

Recently, I've installed VS2022 and installed the following tools msvc v140 - vs 2015 c++ build tools (v14.00), msvc v141 - VS 2017 C++ x64/x86 build tools (v14.16), msvc v142 - VS 2019 C++ x64/...
luckyroo's user avatar
1 vote
0 answers
161 views

What is .NET target platform in Visual Studio

In this question, it is discussed the difference between platform targeting in Visual Studio, I recently found that a .NET option was added there and these lines along others were added in the sln ...
user10191234's user avatar
0 votes
1 answer
490 views

Using Directory.Build.props to copy files from different projects to output dir

I have a solution with a few class libraries and a console project. Each one of the libraries have an Inputs dir next to the .csproj file with a bunch of files. I'm currently doing this in each one of ...
eduherminio's user avatar
  • 1,604
0 votes
0 answers
19 views

AspNetCoreGeneratedDocument - On build server this doesnt get included in the DLL

With .Net 6, razor views are compiledinto the main DLL, under the namespace AspNetCoreGeneratedDocument. I have a solution where this works perfectly well locally, but when building from Jenkins, ...
Ethan Schofer's user avatar
0 votes
0 answers
33 views

Why using "Both" in a gRPC proto project can be considered bad practice?

Why using the "Both" keyword instead of "Server" in a separate project for .proto files in a solution with both a server and a client project can be considered bad practice? My ...
Ivan  Silkin's user avatar
0 votes
0 answers
70 views

donet build error MSB4019 on execute command to sonaqube

When I'am execute this command to build my solution to sonarqube, the follow error apears "C:/Program Files/sonarqube/SonarScanner.MSBuild.exe" begin /key:"iob.br....
Juliano Maciel's user avatar
0 votes
1 answer
46 views

JS files compiled by TypeScript not included when publishing though they are included when building in Debug and Release mode

I have a .NET MAUI project with TypeScript in Scripts\scriptfiles.ts folder that is compiled into wwwroot\js\scriptfiles.js. Everything works well until my client tries to publish it and everything ...
Luke Vo's user avatar
  • 19.3k
2 votes
3 answers
241 views

How to create a nuget package which copies files to the build output of the consumer

There is tons of material online about creating nuget packages, however, there seem to be also tons of options (dotnet pack, nuget.exe pack, msbuild t:pack etc.). I tried several suggestions from the ...
tomwaitforitmy's user avatar
0 votes
0 answers
29 views

How to copy the output directory of one projects into a subfolder under the output directory of an another one?

I have 2 projects and I with the build I want to copy the whole output directory of the project A (A\bin[Debug|Release]\net[WhatEver]\*) under the output directory of project B into a subfolder, like ...
Aaaaaaaa's user avatar
  • 2,075
0 votes
0 answers
22 views

How To Copy Project Files To Output And Import Code From Same Project?

I would like to have the output folder for a particular project (let's call it TestProject) in a solution have all of the elements necessary for publishing a different project (let's call it ...
Trevor Thoele's user avatar
0 votes
1 answer
67 views

New files not found by *-wildcard in MSBuild

We have a modern .NET web application - developed in VisualStudio. A month ago, I wrote a couple of MSBuild configuration scripts to handle deployment smoothly. And they work fine. The application is ...
UglySwede's user avatar
  • 439
0 votes
0 answers
26 views

Automating the build process of our embedded c++ apps, which currently use VisualGDB

I have been tasked with creating a CICD pipeline for our embedded c++ apps which means I want to build our app completely from the command line. I’ll also be using AWS Codepipeline and Codebuild ...
hugo's user avatar
  • 1,205
0 votes
1 answer
20 views

MSBuild target to print project references recursively

I'd like to visualize the entire ProjectReference graph from a given project. Something like msbuild projA.vcxproj /t:ListProjectReferences and get something like: projA.vcxproj -> projB.vcxproj, ...
Darien Pardinas's user avatar
1 vote
2 answers
193 views

How to set absolute path to MSBuild.exe in Cake scripts

I want to build my packages (in .NET Framework project) with Rider, using cake script. I want to use the MSBuild Tools under Rider directories instead of the Visual Studio MSBuild Tools directories. ...
davegurney's user avatar
1 vote
1 answer
44 views

MSbuild : read files with line feeds

Using MSBuild, how to read a text file with carriage return/line feed and get each line content in a property? The file goes like Prod;2.13 Pre-Prod;2.14 Test;2.15 And I would like to get <...
8oris's user avatar
  • 382
0 votes
0 answers
22 views

When/Where is a PublishProfile included in MSBUILD?

We are using MSBUILD for ClickOnce publishing. Since dotnet publish is not able to do see: https://github.com/dotnet/deployment-tools/issues/69, we are using MSBUILD msbuild /target:publish /p:...
msedi's user avatar
  • 1,589
0 votes
1 answer
88 views

HowTo: Azure DevOps YAML Iterate Projects in Solution

In XAML builds, there was a workflow activity which would return the list of projects in a soliton in the correct order for a build based on dependencies See: XAML BuildSettings Class Documentation As ...
David V. Corbin's user avatar
0 votes
1 answer
397 views

How to build my Qt/MSbuild project in Github actions

My project is developed in Qt C++ in Windows environment. I want to build on Github actions by using msbuild and windeployqt. This is my example yml script name: MSBuild on: push: branches: [ &...
Weimin Chan's user avatar
0 votes
1 answer
128 views

Is there a way to pass argument to launchSettings.json in .NET?

I'm using .NET 7 and I have the launchSettings.json file: { "profiles": { "http": { "commandName": "Project", "launchBrowser": true, ...
guirms's user avatar
  • 335
0 votes
1 answer
36 views

ZipArchiveEntry.ExtractToFile() works with "winrar.zip" but not "msbuild.zip"

So I'm using following method to extract an archive. public static void extractArchive(string zipFile, string destination) { destination = Path.GetFullPath(destination); if (!destination....
Pawcio's user avatar
  • 443
1 vote
1 answer
91 views

SLN Configuration File : mapping issues

I want to customise the sln file of my solution to manage: 3 projects 5 configurations: Debug, Production_total, Production_Partial, Release and Recette Each configuration should use "Any CPU&...
8oris's user avatar
  • 382
0 votes
0 answers
185 views

SonarQube Scan multiple C# project (sonar.inclusions issue)

I am using SonarQube Community Edition Version 8.9.10 and Sonar Scanner for MSBuild (5.13.0.66756-net5.0) I have a folder containing multiple C# projects with a single .sln file, which usually takes ...
FarsoFracico's user avatar
0 votes
0 answers
34 views

Updating PublishVersion/MinimumRequiredVersion in .csproj

This is for a OneClick program. Initially, I am getting the revision number from subwcrev and populating the assemblyinfo.cs. I created a pre-build event with this logic. I am able to see the new ...
Drees's user avatar
  • 698
0 votes
2 answers
101 views

Web config transformation fails

We have asp.net web project which we are migrating to .NET SDK-style project with centralized nuget package management. Template that we are using is <Project Sdk="MSBuild.SDK.SystemWeb/4.0.88&...
Bojan Nedeljkovic's user avatar
0 votes
0 answers
358 views

nuget package .dll not copying to bin with msbuild despite dll.refresh file

i'm sure it's me doing something wrong and could do with someone smarter than myself having a look at this. the problem im having is that MSBuild targeting .NET 4.7.2 fails to copy dll referenced in ...
goodsoup's user avatar
1 vote
0 answers
68 views

How does MSBuild resolve dotnet SDKs?

There are various .NET SDKs for SDK-style projects in the *C:\Program Files\dotnet\sdk\<dotnet version>\Sdks* folder. I am trying to understand how MSBuild resolves these SDKs given that the ...
Sam's user avatar
  • 1,524
3 votes
1 answer
516 views

How can I disable Microsoft.Build.Tasks.Git.LocateRepository

I installed VS 2022 Preview version and since that my build time is 10 seconds longer: 1> 9609 ms Microsoft.Build.Tasks.Git.LocateRepository 1 calls I do not want any git related build ...
citykid's user avatar
  • 10.4k
0 votes
1 answer
73 views

Passing /Zm flag to msbuild

i am facing intermittent issues :- C1060: compiler is out of heap space . why do we hit such issues? As per the documentations :- here & here , with the usage of \Zm<factor> we can control ...
vam's user avatar
  • 53
1 vote
0 answers
99 views

Where is the `.fsproj` project file documented?

More specifically: Is there a dedicated docs page listing "properties" that are idiosyncratic to F# .fsproj project files? Why am I asking? Started learning F# a couple of days ago, but just ...
toraritte's user avatar
  • 7,235
0 votes
1 answer
323 views

How to restore nuget packages from CLI like Visual Studio does

We have a script to build our application in C#. We have most of projects in .NET7 which builds fine but I am dealing with old .NET Framework projects. We cannot upgrade those projects (or it will ...
Jirka Picek's user avatar
0 votes
1 answer
209 views

Include folder in referenced project as MauiAssets

Goal I have a MAUI project, which references a (non-MAUI) "core" library project. The core project is where a user of this framework will (mostly) work in. I want to include files from the ...
Raphael Schmitz's user avatar
0 votes
0 answers
17 views

VS 2019 Community - How to install MSBuild MT Task?

How can I install the MT Task with VS 2019? Which option at the installer includes this task? Or do I have to install the VS 2019 Build tools additionally? Tried to use the MT task in a build target ...
VBWebProfi's user avatar
1 vote
1 answer
47 views

Automation of Visual Studio 2022 publish action to dotnet cli commends

smart people! I am trying to build Jenkis pipeline automating publish step from Visual Studio using dotnet cli. First about publish step in VS they press option Publish and than they select all flags. ...
YesWoman's user avatar
0 votes
0 answers
39 views

dotnet build/publish library project adds all dependencies

Within a Visual Studio solution I have several library projects, which generate DLLs. The DLLs are dynamically loaded from an application, therefor no further dependencies to other libraries (logging, ...
qpx's user avatar
  • 1
0 votes
1 answer
86 views

Target won't run if Outputs is empty (incremental build)

I have an incremental build setup. When the output files do not exist (e.g. first build) the target does not run since Outputs="@(MyOutput)" results in an empty list. To workaround this, I ...
Max Toro's user avatar
  • 28.5k
0 votes
0 answers
33 views

How to automate NanoFramework project modification: download, resource file change, NuGet addition, build, and obtain binaries in .NET Core APP?

I'm working on a project where I need to automate the process of modifying a NanoFramework project. I want to create a generic .NET Core solution that can perform the following tasks: Download a base ...
ijaz noufal's user avatar
0 votes
1 answer
77 views

How to access the SDK name in MSBuild

I have a C# SDK projectfile: <Project Sdk="Microsoft.NET.Sdk"> ... </Project> How do I get the SDK name as variable? Usecase: I have a quite big solution, containing WPF ...
howardButcher's user avatar
0 votes
0 answers
52 views

"fatal error C1902: Program database manager mismatch; please check your installation " on Cygwin Jenkins Agent via SSH

I'm trying to get an msbuild working (Visual C++ 2008) using a vagrant Jenkins agent however I'm running into this error: fatal error C1902: Program database manager mismatch; please check your ...
cberk1's user avatar
  • 33
4 votes
0 answers
189 views

Why has Dotnet build command stopped working?

I am debugging a Maui app on Macbook. Because of the various issues with VS for mac I have been using a build command: dotnet build -t:Run -f net7.0-ios -p:_DeviceName=:v2:udid=0D52415F-8501-4DCF-81F1-...
BuckBuchanan's user avatar
0 votes
1 answer
30 views

Git Branch and Hashref awareness during runtime using MS build

I want to read git Head value and Hash ref value from refs/heads/Branchname and store them into a file path. I am able to read the value and store them into file Now here is what I want the thing is ...
Kapil Sharma's user avatar
0 votes
0 answers
54 views

Powershell script in Visual Studio: how to do post built events

Working with Visual Studio Community 2022, I have a PowerShell script in my Solution (I installed PowerShellTools.2022.2023.8.0.vsix) and i'd like to do some post-build events (copying the script to ...
8oris's user avatar
  • 382
0 votes
1 answer
266 views

TeamCity Build - MSB3644: The reference assemblies for .NETFramework,Version=v7.0 were not found

I have a TeamCity Build Config that I have updated from the "Microsoft Visual Studio solution (.sln) runner" to use a ".Net Runner" msbuild command to build my API solution. ...
tadhg88's user avatar