All Questions
531
questions
1
vote
2
answers
78
views
Directory.Build.props only respected when building .sln file
When I build my projects with the MyConfig target, I want the code to be optimized, and I don't want any .pdb files.
To achieve this, I have created a Directory.Build.props file like this in the root ...
1
vote
1
answer
37
views
Is it possible to attach Visual Studio Code debugger using System.Diagnostics.Debugger.Launch()?
The context involves trying to debug a Fody addin (MsBuild task).
Using System.Diagnostics.Debugger.Launch(); only prompts me with Visual Studio debuggers.
0
votes
0
answers
25
views
Facing issue using Msbuild for building .NET Core project on Windows 2012 server
Our application is developed on .NET 6 framework and when we tried to use this command in a .bat file and ran on the local system, we are able to build solution and everything is working fine.
When we ...
0
votes
0
answers
12
views
How can I build a project if the build machine doesn't have the SDK for one of the (unused) target frameworks of a library?
I have an ASP.NET Core project that targets .NET 5.0. That project depends on a library that targets .NET Standard 2.1, .NET 5.0 and .NET 8.0. When I build the project on a build machine that only has ...
0
votes
1
answer
55
views
.NET 8.0 Project fails build Could not load System.Runtime - Reference Assemblies should not be loaded for execution
I have a project that is multi-targeting net8.0-windows and net48. In both configurations it has no warnings or errors. It builds fine in net48, but when I try to build the project in net8.0-windows ...
0
votes
1
answer
239
views
AzureDevops build pipeline gets cancelled due to time out during donet build command
I have a build pipeline that build my .net 5 solution projects in Azure Devops. It was working fine till now, but has recently started failing in the build stage due to time out. The build command ...
0
votes
1
answer
55
views
How to successfully build a Microsoft.Dotnet.Wpf.sln repository downloaded from GitHub at your home PC?
I am trying to build a Microsoft.Dotnet.Wpf.sln which I downloaded from GitHub here. I installed Visual Studio 2022 Preview as mentioned in the instruction. Now when I open the Microsoft.Dotnet.Wpf....
0
votes
0
answers
32
views
MSBUILD .NET Core solution not setting the product version over the command line
I am currently setting the AssemblyVersion over the command line:
& $msbuild "D:\Jenkins\workspace\Snarks\KPS.MAX graphics\KPS.MAX graphics - Compile\MainProj.sln" -r -m:7 -t:Build "...
0
votes
1
answer
100
views
How to create a multitarget NuGet package with the content file included just once
I'm writing a .NET binding project for an external c++ library. Wanted to include the library into the nupkg file, so the user just have to install the package to use it. The library is platform ...
0
votes
0
answers
24
views
Handling System package dependencies for packages in RestoreSources path
I have a project where I have PackageReference field for few packages. I am trying to restore and build this project on a ubuntu system(basically a docker image) with no internet access.
I would like ...
2
votes
1
answer
81
views
How to define project dependency without copying or consuming output
I want to use a <ProjectReference> to ensure a dependency project builds first. I don't want to reference the project's output assembly or copy any files or transient dependencies of the ...
1
vote
1
answer
106
views
NET Core - Partial class created during the build process, is only used from the second run onwards
I have a Visual Studio 2019 solution and the projects it contains have been converted from .NET Framework 4.8 to NET Core 8. In VS2019, building the projects and the solution worked without any ...
0
votes
3
answers
94
views
Use MSBuild to concatenate JavaScript files with regexes
I concatenate javascript in msbuild like this:
<ItemGroup>
<JsFiles Include="wwwroot/**/*.js" />
</ItemGroup>
<ItemGroup>
<JsLines Include="$([System.IO....
0
votes
0
answers
51
views
.NET Single file - include files other than libraries (e.g. *.conf)
Is there any way in .NET 8 how to put a *.conf file in single file EXE?
I need to bundle Firebird embedded in my application. Using IncludeNativeLibrariesForSelfExtract will include all Firebird dlls, ...
0
votes
1
answer
766
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 ...