core
core copied to clipboard
Unable to create asp.net core api with dotnet cli
Describe the bug
Unable to run newly created ASP.NET Core App
To Reproduce
- Install dotnet cli 6.0
- No sources are installed by default, so add nuget source.
dotnet nuget add source https://api.nuget.org/v3/index.json -n nuget.org - Install
Microsoft.Identity.Web.ProjectTemplatestemplate.dotnet new -i Microsoft.Identity.Web.ProjectTemplates - Create project.
dotnet new webapi2 -o .. - Run project.
dotnet run
Exceptions (if any)
Building...
It was not possible to find any compatible framework version
The framework 'Microsoft.AspNetCore.App', version '3.1.0' (x64) was not found.
- The following frameworks were found:
6.0.0 at [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
You can resolve the problem by installing the specified framework and/or SDK.
The specified framework can be found at:
- https://aka.ms/dotnet-core-applaunch?framework=Microsoft.AspNetCore.App&framework_version=3.1.0&arch=x64&rid=win10-x64
Further technical details
dotnet --info Output
.NET SDK (reflecting any global.json):
Version: 6.0.100
Commit: 9e8b04bbff
Runtime Environment:
OS Name: Windows
OS Version: 10.0.18363
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\6.0.100\
Host (useful for support):
Version: 6.0.0
Commit: 4822e3c3aa
.NET SDKs installed:
6.0.100 [C:\Program Files\dotnet\sdk]
.NET runtimes installed:
Microsoft.AspNetCore.App 6.0.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 3.1.15 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 6.0.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 3.1.15 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 6.0.0 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
To install additional .NET runtimes or SDKs:
https://aka.ms/dotnet-download
Creating it with Visual Studio 2022 did not work either.

The Identity.Web templates are owned by https://github.com/AzureAD/microsoft-identity-web.
The WebApi project targets 3.1 which you don't have installed: https://github.com/AzureAD/microsoft-identity-web/blob/eb618181d42599ee45e6ddf44ed919e2fa2f71ec/ProjectTemplates/templates/WebApi-CSharp/Company.WebApplication1.csproj#L3
You need to install 3.1 or retarget to 6.0.
Hi @ihack2712. We have added the "Needs: Author Feedback" label to this issue, which indicates that we have an open question for you before we can take further action. This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.
I did install it estimer through the link on the error, still not working
Is the dotnet --info above from before or after? It shows you have .NET 3.1 but not ASP.NET 3.1 (not sure how you managed that).
Microsoft.AspNetCore.App 6.0.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 3.1.15 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 6.0.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Unsure*
Ok, what does it show now?
C:\Users\krsjbr>dotnet --info
.NET SDK (reflecting any global.json):
Version: 6.0.100
Commit: 9e8b04bbff
Runtime Environment:
OS Name: Windows
OS Version: 10.0.18363
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\6.0.100\
Host (useful for support):
Version: 6.0.0
Commit: 4822e3c3aa
.NET SDKs installed:
6.0.100 [C:\Program Files\dotnet\sdk]
.NET runtimes installed:
Microsoft.AspNetCore.App 6.0.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 3.1.15 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 3.1.21 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 6.0.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 3.1.15 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 6.0.0 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
To install additional .NET runtimes or SDKs:
https://aka.ms/dotnet-download
You're still missing Microsoft.AspNetCore.App 3.1. You installed dotnet-runtime-3.1.21-win-x64.exe? Try this one instead:
https://dotnet.microsoft.com/en-us/download/dotnet/thank-you/runtime-aspnetcore-3.1.21-windows-hosting-bundle-installer
Oh.. Thanks.. It works :D
Re-opening to figure out why this link doesn't download the right installer:
https://aka.ms/dotnet-core-applaunch?framework=Microsoft.AspNetCore.App&framework_version=3.1.0&arch=x64&rid=win10-x64
It links to https://dotnet.microsoft.com/en-us/download/dotnet/3.1/runtime, when it should go to https://dotnet.microsoft.com/en-us/download/dotnet/3.1
/cc @richlander @mairaw
It links to dotnet.microsoft.com/en-us/download/dotnet/3.1/runtime, when it should go to dotnet.microsoft.com/en-us/download/dotnet/3.1
@Tratcher I think this is correct...the message indicated a missing runtime and provides a link to the specific runtime installers. Removing the /runtime in the URI takes you to the general download pages which becomes even more a choose-your-own-adventure place (do I need SDK, do I need linux, do i need...). The runtime download page (while still not perfect as I think this specific one should have just taken you to the server runtime bundle IMO) has the download links that provide you the version-specific downloads.
@timheuer the link is aspnet specific, but 2/3's of the downloads on /3.1/runtime do no install aspnet. That's where the customer got confused. Most of the downloads offered on from /3.1 do include aspnet, or are at least much more clearly labeled.
ack on the much-more clearly labeled! Yeah if the querystring has the absolute need, agreed giving the download direct is a better experience. I opine that the base download page is more confusing (wall of links) -- would love to see the runtime-specific links in this scenario just give me the right thing as it seems we have the info in the QS
Giving a direct download is on our backlog and I hope my team is able to take on that work soon (timeline still TBD).
BTW, the info is in the QS, but when the request gets to the site that info has been lost. @richlander and I were trying to come up with a URL scheme that could work for different scenarios as well.
Thanks for contacting us.
We're moving this issue to the .NET 7 Planning milestone for future evaluation / consideration. We would like to keep this around to collect more feedback, which can help us with prioritizing this work. We will re-evaluate this issue, during our next planning meeting(s).
If we later determine, that the issue has no community involvement, or it's very rare and low-impact issue, we will close it - so that the team can focus on more important and high impact issues.
To learn more about what to expect next and how this issue will be handled you can read more about our triage process here.
@mairaw @bradygaster Any update on this? Should this issue be tracked somewhere else?
This seems like a bug on the .NET site repo, can @mairaw transfer to there? Or create an issue to which we can link this one and close?
We're still working on this. We can transfer this to the core repo if you'd like.