Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

126
Views
Is csproj runtime ignored by dotnet publish?

I've been hardening our build pipelines and moved the runtime into the csproj to ensure local builds and command line build/publish (in the pipeline) have the same runtime.

However I'm now questioning myself, as the published output when publishing locally does not have the runtime in the folder path (unlike how it is documented).

If not specified, it defaults to [project_file_folder]/bin/[configuration]/[framework]/publish/ for a framework-dependent executable and cross-platform binaries. It defaults to [project_file_folder]/bin/[configuration]/[framework]/[runtime]/publish/ for a self-contained executable.

https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-publish#arguments

It is leading me to think that the runtime in csproj is just for nuget restores? i.e. is dotnet build --runtime [runtime] actually just passed to dotnet restore --runtime [runtime]

Whereas the runtime for dotnet publish is for the actual framework independent self-contained builds?

Background

The reason I haven't noticed this sooner is that I am doing explicit:

NuGetAuthenticate (Azure Pipeline task for authenticating private feeds) dotnet restore dotnet build dotnet publish -self-contained --no-build

I assumed the publish was using the RuntimeIdentifiers in the csproj, but I think now perhaps it's a cross platform platform build and possibly self containing under the current runtime of the build agent!

over 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!