aspnetcore: A compatible installed .NET Core SDK for global.json version [3.1.201] from [D:\local\repository\global.json] was not found
Describe the bug
The .NET Core SDK for latest LTS release (3.1.3, SDK 3.1.201) does not exists on Azure App Services.
To Reproduce
Use global.json with latest LTS SDK:
{
"sdk": {
"version": "3.1.201"
}
}
Azure deployment log:
Handling ASP.NET Core Web Application deployment.
A compatible installed .NET Core SDK for global.json version [3.1.201] from [D:\local\repository\global.json] was not found
1.1.14 [D:\Program Files (x86)\dotnet\sdk]
Install the [3.1.201] .NET Core SDK or update [D:\local\repository\global.json] with an installed .NET Core SDK:
2.1.509 [D:\Program Files (x86)\dotnet\sdk]
2.1.513 [D:\Program Files (x86)\dotnet\sdk]
2.2.109 [D:\Program Files (x86)\dotnet\sdk]
3.1.103 [D:\Program Files (x86)\dotnet\sdk]
Failed exitCode=-2147450735, command=dotnet restore
Further technical details
- ASP.NET Core version 3.1.3 (SDK 3.1.201)
- Include the output of
dotnet --info
- Visual Studio 2016 16.5.4
dotnet --info
.NET Core SDK (reflecting any global.json):
Version: 3.1.103
Commit: 6f74c4a1dd
Runtime Environment:
OS Name: Windows
OS Version: 10.0.14393
OS Platform: Windows
RID: win10-x86
Base Path: D:\Program Files (x86)\dotnet\sdk\3.1.103\
Host (useful for support):
Version: 3.1.3
Commit: 4a9f85e9f8
.NET Core SDKs installed:
1.1.14 [D:\Program Files (x86)\dotnet\sdk]
2.1.509 [D:\Program Files (x86)\dotnet\sdk]
2.1.513 [D:\Program Files (x86)\dotnet\sdk]
2.2.109 [D:\Program Files (x86)\dotnet\sdk]
3.1.103 [D:\Program Files (x86)\dotnet\sdk]
.NET Core runtimes installed:
Microsoft.AspNetCore.All 2.1.14 [D:\Program Files (x86)\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.1.15 [D:\Program Files (x86)\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.1.17 [D:\Program Files (x86)\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.2.8 [D:\Program Files (x86)\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.App 2.1.14 [D:\Program Files (x86)\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.1.15 [D:\Program Files (x86)\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.1.17 [D:\Program Files (x86)\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.2.8 [D:\Program Files (x86)\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 3.0.1 [D:\Program Files (x86)\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 3.0.2 [D:\Program Files (x86)\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 3.0.3 [D:\Program Files (x86)\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 3.1.0 [D:\Program Files (x86)\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 3.1.1 [D:\Program Files (x86)\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 3.1.3 [D:\Program Files (x86)\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 1.0.16 [D:\Program Files (x86)\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 1.1.13 [D:\Program Files (x86)\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.0.9 [D:\Program Files (x86)\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.1.14 [D:\Program Files (x86)\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.1.17 [D:\Program Files (x86)\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.2.8 [D:\Program Files (x86)\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 3.0.2 [D:\Program Files (x86)\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 3.0.3 [D:\Program Files (x86)\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 3.1.1 [D:\Program Files (x86)\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 3.1.3 [D:\Program Files (x86)\dotnet\shared\Microsoft.NETCore.App]
To install additional .NET Core runtimes or SDKs:
https://aka.ms/dotnet-download
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 17 (9 by maintainers)
As I said above, if you need absolute control over what SDK builds your project, you shouldn’t be relying on Azure App Services automatic build support through Kudo. Instead, manage that yourself using a CI/CD pipeline, or by publishing compiled artifacts using VS or web deploy.
As for the VS issue, please file a bug on https://github.com/dotnet/projects-system if you have a repo of a case where VS is failing to open a project with the latest SDK.
You don’t (can’t) specify an SDK version in the project file. You choose the Target Framework that the app will run against (and the references to compile against that represent that runtime).
Both VS and App Services will pick the newest SDK in the absence of a global.json, which is the by design behavior. However, at least as of the 3.0.100 SDK (and likely before), the newest SDK should be able to compile projects targeting any version of the runtime.
If there are examples where that is NOT working, I suggest filing them with details on https://github.com/dotnet/sdk.
In general, rolling out new SDKs to App Service is quite a difficult endeavor already, while we’re working on improving that, it’s likely that there will always be periods of time where the latest SDK isn’t available on App Services, and there is no guarantee that every patch version of the SDK will be present. If you need precise control of the SDK that your app is built with, I suggest deployed already built assets to Azure App Services, either using a CI/CD system (like GitHub Actions, or Azure DevOps Pipelines), or WebDeploy/VS Publish.
Closing, as I don’t think there is an immediate action for us to take here.