Questions tagged [msbuild]
Microsoft Build Engine, also known as MSBuild, is a build platform for managed code and was part of .NET Framework.
14,992
questions
-1
votes
1
answer
44
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(...
0
votes
0
answers
22
views
How to publish a net cross platform application without rebuilding it and without restoring it?
Let's say I have simple Hello World cross platform app which I need to work on both win7-x64 and linux-x64.
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<...
1
vote
0
answers
7
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 ...
0
votes
0
answers
23
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/...
1
vote
0
answers
57
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 ...
0
votes
1
answer
26
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 ...
0
votes
0
answers
6
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, ...
0
votes
0
answers
21
views
Why not use "Both" in a gRPC proto project?
I want to use the "Both" keyword instead of "Server" in a separate project for .proto files in a solution with both a server and a client project. But the company's software ...
0
votes
0
answers
20
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....
0
votes
1
answer
26
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 ...
2
votes
2
answers
74
views
+50
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 ...
0
votes
0
answers
26
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 ...
0
votes
0
answers
20
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 ...
0
votes
1
answer
36
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 ...
0
votes
0
answers
21
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 ...
0
votes
1
answer
8
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, ...
1
vote
2
answers
103
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. ...
1
vote
1
answer
30
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
<...
0
votes
0
answers
11
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:...
0
votes
1
answer
43
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 ...
0
votes
1
answer
129
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: [ &...
0
votes
1
answer
36
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,
...
0
votes
0
answers
18
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....
1
vote
1
answer
39
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&...
0
votes
0
answers
41
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 ...
0
votes
0
answers
29
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 ...
0
votes
1
answer
34
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&...
0
votes
0
answers
126
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 ...
1
vote
0
answers
36
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 ...
1
vote
1
answer
111
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 ...
0
votes
1
answer
33
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 ...
0
votes
0
answers
49
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 ...
0
votes
1
answer
53
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 ...
0
votes
1
answer
52
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 ...
0
votes
0
answers
8
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 ...
1
vote
1
answer
27
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.
...
0
votes
0
answers
18
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, ...
0
votes
1
answer
40
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 ...
0
votes
0
answers
20
views
Issue when programmatically building the .net 7 console app
ConsoleApp5 builds fine with cmd dotnet build.But when i try to do that same programmatically
using Microsoft.Build.Evaluation;
using Microsoft.Build.Execution;
using Microsoft.Build....
0
votes
0
answers
20
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 ...
0
votes
1
answer
46
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 ...
0
votes
0
answers
29
views
CS0012 error how to resolve when reference other package like NPOI
Problem:i have a project, reference two package A and B,and A reference NPOI 2.6.0 version,but B reference NPOI 2.6.2 verison; according to my understand. it should auto use 2.6.2 version NPOI,and ...
0
votes
0
answers
23
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 ...
0
votes
0
answers
90
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-...
0
votes
1
answer
20
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 ...
0
votes
0
answers
41
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 ...
0
votes
1
answer
68
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.
...
0
votes
2
answers
74
views
How to prevent files in debug/release folder from been deleted?
We have some binary files that are not generated from code that we ship with our application. They were placed manually in debug/release folder. VS didn't touched those files when compiling the ...
1
vote
1
answer
54
views
Roslyn workspace API not loading properly for a third-party solution
I'm trying to enumerate all Document items in each Project instance using the Roslyn Workspace API for a third-party solution that has been provided to me. My code looks like this:
using System;
using ...
0
votes
0
answers
151
views
The target "ContainerWaitForWarmupCompletion" does not exist in the project
All my projects fail on this err. No change in source. Previously it was able to fix it by restarting visual studio, but now it has no effect.
Severity Code Description Project File Line ...