vscode-dotnet-runtime/vscode-dotnet-sdk-extension/images
Noah Gilson 2a876ace5d
Permit Installing .NET via a package.json file (#1976)
* Permit Installing .NET via a package.json file

Extensions that rely on .NET often have a slow startup time due to our existing API.

For extensions that want the .NET runtime to be installed as soon as possible, they can now also make an API request in their package.json.

They should add a [IDotnetAcquireContext](https://github.com/dotnet/vscode-dotnet-runtime/blob/main/vscode-dotnet-runtime-library/src/IDotnetAcquireContext.ts) object in a section titled 'x-dotnet-acquire' to do so. They don't need to include the `requestingExtensionId`, since this is already in their `package.json`,

This should go at the root of a `package.json`, and not in the `contributes` section.
```
"x-dotnet-acquire": {
    "version": "8.0",
    "mode": "aspnetcore"
}
```

We run the install on startup and also whenever a new extension is installed via the onDidChange API. https://code.visualstudio.com/api/references/vscode-api#Extension<T>

You can easily test this by modifying the SDK extension and adding this, then packging t with `vsce`, installing it, and running the Runtime Extension under the Debug tab. If you do so, you will see that:

If you install a new extension, the request is made.

If you had already installed the extension, the request is also made.

* Respond to linter

* Add a very basic test.

* Fix typo

* Fix typo
2024-10-04 09:22:04 -07:00
..
dotnetIcon.png Permit Installing .NET via a package.json file (#1976) 2024-10-04 09:22:04 -07:00