-
Notifications
You must be signed in to change notification settings - Fork 6k
Description
Description
When running dotnet tool install --local, now a manifest will be created if one does not exist instead of failing.
This was implemented by making createManifestIfNeeded
be enabled by default. This is a breaking change, since users may have relied on the failure behavior before to check if they needed to create a manifest, but now we will create one according to the rules followed by the flag, documented at: #39600 regardless of if they set the flag or not.
They can turn off the behavior by setting --create-manifest-if-needed=false
.
This was implemented in dotnet/sdk#48906.
The -d
flag on dotnet tool install
was previously added to show a user where we looked for a manifests in the error we'd give when there was no manifest. We dont show that error anymore since we always make a manifest if none exist, and that flag never actually worked, so we should not recommend using that flag anymore.
Version
.NET 10 Preview 7
Previous behavior
When a user tries to install a .NET tool as a local tool on a folder that does not contain the manifest, they get an error: Cannot find a manifest file.
Example:
dotnet/sdk#15254 (comment)
New behavior
createManifestIfNeeded, which is documented in #39600 is now enabled by default, so the manifest will be created by default if it does not exist when a tool is installed as a local tool.
Type of breaking change
- Binary incompatible: Existing binaries might encounter a breaking change in behavior, such as failure to load or execute, and if so, require recompilation.
- Source incompatible: When recompiled using the new SDK or component or to target the new runtime, existing source code might require source changes to compile successfully.
- Behavioral change: Existing binaries might behave differently at run time.
Reason for change
This is a breaking change, since users may have relied on the failure behavior before to check if they needed to create a manifest, but now we will create one according to the rules followed by the flag, documented at: #39600 regardless of if they set the flag or not.
We did this change so that dotnet tool install local would work by default to improve the UX. We didn't do this initially because we were concerned about creating a manifest in a working directory rather than the repository root, but now we try to put the manifest in the repo root if possible, so that concern is lesser.
Recommended action
They can turn off the behavior by setting --create-manifest-if-needed=false if desired.
Feature area
SDK
Affected APIs
No response