How to check if the current invocation is running `publish`?

Open
#26,324 27 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
csharp
Domain
build-system, cli

Research direction

No file, test, or entry point is named. Start by tracing how the .NET SDK distinguishes build and publish invocations in project evaluation, then determine what supported project-file signal would expose that distinction; done means a defined way to select self-contained behavior only for publish.

Written by the indexing model from the issue text.

Description

Area-NetSDK

Title basically says it all -- but in certain cases I'd like to know in the project file whether we're doing a build or a publish. In particular, I might want a non-self-contained build by default, but always want a self-contained publish.

Dominant language
C#
Stars
3.2k
Forks
1.3k
Avg merge
4d 1h
Merged PRs (30d)
235

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from dotnet/sdk

All issues in dotnet/sdk

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.