Skip to content

Conversation

@agocke
Copy link
Member

@agocke agocke commented Oct 17, 2025

No description provided.

* Executable names are preserved in the command line, meaning apps can be easily recognized based on their names.
* Because the apphost is a native binary, native assets like manifests can be attached to them.

The apphost will generally use a global install of the .NET framework, where install locations are defined by [install locations](accepted/2021/install-location-per-architecture.md).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The apphost will generally use a global install of the .NET framework, where install locations are defined by [install locations](accepted/2021/install-location-per-architecture.md).
The apphost will generally use a global install of the .NET runtime, where install locations are defined by [install locations](accepted/2021/install-location-per-architecture.md).

We should say ".NET", ".NET runtime" or ".NET Core". ".NET framework" is misleading.


The apphost will generally use a global install of the .NET framework, where install locations are defined by [install locations](accepted/2021/install-location-per-architecture.md).

The .NET framework path can also be customized on a per-execution basis. The DOTNET_ROOT environment variable can be used to point to the custom location. Details for all DOTNET_ROOT configuration can also be found in [install locations](accepted/2021/install-location-per-architecture.md).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The .NET framework path can also be customized on a per-execution basis. The DOTNET_ROOT environment variable can be used to point to the custom location. Details for all DOTNET_ROOT configuration can also be found in [install locations](accepted/2021/install-location-per-architecture.md).
The .NET runtime path can also be customized on a per-execution basis. The DOTNET_ROOT environment variable can be used to point to the custom location. Details for all DOTNET_ROOT configuration can also be found in [install locations](accepted/2021/install-location-per-architecture.md).


The .NET framework path can also be customized on a per-execution basis. The DOTNET_ROOT environment variable can be used to point to the custom location. Details for all DOTNET_ROOT configuration can also be found in [install locations](accepted/2021/install-location-per-architecture.md).

In general, the best practice for using `DOTNET_ROOT` to set the framework location for an app is to:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
In general, the best practice for using `DOTNET_ROOT` to set the framework location for an app is to:
In general, the best practice for using `DOTNET_ROOT` to set the runtime location for an app is to:

@jkotas
Copy link
Member

jkotas commented Oct 17, 2025

Should this live in the official docs instead?

@agocke
Copy link
Member Author

agocke commented Oct 17, 2025

Should this live in the official docs instead?

I debated this. I also wonder if we should put the info in the linked install-location docs. I'd be fine with either answer.

@jkotas
Copy link
Member

jkotas commented Oct 17, 2025

I debated this. I also wonder if we should put the info in the linked install-location docs. I'd be fine with either answer.

https://learn.microsoft.com/en-us/dotnet/core/deploying/ has similar content that has partial overlap. I think it would best to fold this content into that doc.

For example, the official doc just says "You can run this executable directly instead of calling dotnet .dll, which is still an acceptable way to run the app." without explaining the tradeoff and giving a strong recommendation.


In general, the best practice for using `DOTNET_ROOT` to set the runtime location for an app is to:

1. Clear DOTNET_ROOT environment variables first, meaning all environment variables that start with the text `DOTNET_ROOT`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd link to https://learn.microsoft.com/en-us/dotnet/core/tools/dotnet-environment-variables#dotnet_root-dotnet_rootx86-dotnet_root_x86-dotnet_root_x64 since I don't think it's widely known that there are multiple variations of DOTNET_ROOT

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree. That adds context to why this needs to be done.

In general, the best practice for using `DOTNET_ROOT` to set the runtime location for an app is to:

1. Clear DOTNET_ROOT environment variables first, meaning all environment variables that start with the text `DOTNET_ROOT`.
2. Set `DOTNET_ROOT`, and only `DOTNET_ROOT`, to the target path.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be worth mentioning that if you are a tool launched by dotnet or MSBuild (since 18.x), you can determine the path from DOTNET_HOST_PATH (documented at https://learn.microsoft.com/en-us/dotnet/core/tools/dotnet-environment-variables#dotnet_host_path)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: that DOTNET_HOST_PATH doc is also being updated: dotnet/docs#49422

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No: DOTNET_HOST_PATH is an SDK-only property. You can only rely on it if you were launched from the SDK. Since only things which ship in the SDK can count on being launched by the SDK, this should not be a public guarantee. It is an implementation detail for SDK apps.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I know that's SDK only property, I was just thinking it's a common scenario and might be good mentioning it here.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It’s not a common scenario though: it’s only for Microsoft apps that ship in the sdk, or maybe for tools that people launch with MSBuild. One of those is internal-only and the other is only relevant for people who don’t have .NET globally installed.

agocke and others added 3 commits October 23, 2025 11:20
Co-authored-by: Alexander Köplinger <[email protected]>
Co-authored-by: Alexander Köplinger <[email protected]>
@agocke
Copy link
Member Author

agocke commented Oct 24, 2025

Closing in favor of dotnet/docs#49430

@agocke agocke closed this Oct 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants