This extension provides a unified way for other extensions like the C# and C# Dev Kit extensions to install local versions of the .NET Runtime, and machine-wide versions of the .NET SDK. Those extensions tell the .NET Install Tool when they would like a .NET SDK to be on the machine, and we install one for them if there's not already one that matches the SDK they need to run properly. In the future, this tool may support allowing users to call the API via VS Code to install .NET and pick a version of the SDK to install themselves.
This extension was probably included as a dependency of one of the following extensions, though this list is not exhaustive:
The above extensions call into this extension to provide a unified way of downloading shared .NET Runtimes or .NET SDKs. If you already have an installation of .NET that you'd like to use, see the troubleshooting section below. If you want to remove this extension completely, you will need to uninstall any extensions that depend on it first. If this extension is uninstalled, any .NET Runtimes installed by it will also be removed.
Try adding the requesting extension to the dotnetAcquisitionExtension.existingDotnetPath
setting in your vscode.json settings file. You can read more about using external installations in our documentation, but here's an example of how to tell the C# extension to use your existing .NET installation:
"dotnetAcquisitionExtension.existingDotnetPath": [
{
"extensionId": "ms-dotnettools.csharp",
"path": "C:\\Program Files\\dotnet\\dotnet.exe"
}
]
For C# Dev Kit you would use the same thing, but with the extension ID ms-dotnettools.csdevkit
. Other extensions, like the MAUI and Unity extensions, will have their own extension IDs that you can find in the extension pane by right-clicking on them and choosing 'Copy Extension ID'.
NOTE: You'll need to make a new item in the settings array for each extension that uses this extension to acquire .NET.
It can sometimes take a while to download .NET. While the default download time is 600 seconds, if you need more time you can set the dotnetAcquisitionExtension.installTimeoutValue
setting to change that timeout. Here's an example of increasing the download timeout to 11 minutes:
{
"dotnetAcquisitionExtension.installTimeoutValue": 660
}
You can read more about changing the installation timeout in our documentation.
This is a known issue with axios, the system we use to make web-requests. The requests we make need to be routed through the proxy. We have logic to try to detect your proxy automatically. If your proxy does not get detected by us, please try adding it here. You may want to consider temporarily switching to version 1.7.2 of the runtime extension if you are still experiencing issues as this version does not use axios. Note that proxies that require additional credentials are not yet supported.
Note: GFW / China also blocks some of our requests, which may be why our extension thinks you are offline or times out.
You can add the proxy in the extension settings like following the advice above for timeouts.
{
"dotnetSDKAcquisitionExtension.proxyUrl": "https://your_proxy_url:port"
}
Prior to the release of this extension, extension authors had no way of knowing if the .NET Runtime was installed on their target machines. Other solutions had a number of challenges:
- Duplication of .NET runtimes and slow updates: Each extension was acquiring its own copy of .NET, wasting disk space.
- Clean up: When extensions installed .NET in a non-VSCode-managed folder location it was likely to be left behind.
- Servicing and floating versions: It was difficult to ensure that extensions would use the latest releases, particularly without re-shipping their extension.
- Corrupted installations: Corrupted installations could arise when VS Code was shut down mid-download or unzip.
- Network security policies: Alternative installation methods could have resulted in errors due to blocking from network security policies.
- Locked down environments: Some developers are unable to freely install software, requiring the ability to install extensions manually via a VSIX.
- Missing dependencies: Users may run into situations where .NET cannot run as-is, requiring the installation of missing pieces.
This extension attempts to solve the above issues.
The .NET Install Tool is a .NET Foundation project.
See the .NET home repo to find other .NET-related projects.
.NET (including this repo) is licensed under the MIT license.
Please note that this extension collects telemetry by default and aims to follow the VS Code Telemetry Policy. You may disable this telemetry in the extension settings.