-
Notifications
You must be signed in to change notification settings - Fork 10.3k
With .NET 7.0 SDK, I cannot create .NET 6.0 web project, the target net6.0 can't be found. #39731
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
From Nicole, this is only a web template issue so routing to aspnet |
@dougbu any idea why this may be the case? |
Also tagging @joeloff in case you have thoughts too |
@wtgodbe wasn't there an issue in earlier 7.0 SDKs relating to |
There was an issue a couple weeks ago with |
@wtgodbe do you have any updates here? |
I've confirmed that it repros on the SDK mentioned, but not on an older SDK from October, so something changed recently to introduce this. I'm still investigating |
I believe this is related to dotnet/installer#12946, the error doesn't repro on SDKs before we added the |
Also adding @vlada-shubina for the above question |
I think this would be the expected behavior if you just installed the .NET 7 SDK standalone. For the With Visual Studio it works a bit different, so it's possible there's a bug in the setup authoring. But I think the way it's supposed to work in Visual Studio is that you wouldn't get the templates for .NET 6 unless you installed the .NET 6 runtime (as you wouldn't by default be able to run a project targeting 6.0 without the 6.0 runtime). What versions of the .NET SDK and runtimes are installed? Can you paste the output of Also adding @joeloff as he is more familiar with the VS setup authoring. |
I was debugging the templating engine and there is the |
For VS we insert multiple installers for the templates, e.g. for the 6.0 SDK there would be the 6.0 copies of the 5.0, 3.1 templates. These typically only ship with VS. |
@joeloff No, they should ideally be updated to 6.0.100 or whatever the latest version available for the 6.0 band is. For example: https://github.com/dotnet/installer/blob/release/6.0.1xx/eng/Versions.props#L34 |
Right, but the ASP.NET ones are tracking runtime versions so those should be 6.0.1 or 6.0.2 I think |
It sounds like we should update https://github.com/dotnet/installer/blob/1a828392f79d5d7a391b2a387e962e204fb245cd/eng/Versions.props#L109-L111, but if that was the issue, wouldn't 5.0 Asp.Net templates be broken too because of line 110? |
I'm not sure |
Opened dotnet/installer#13113 to see if it helps |
dotnet/installer#13113 didn't do the trick - @MichalPavlik were you able to get anywhere in your investigation? |
The package for net6 is loaded and scanned for templates, so it seems they are filtered out later in the process. I'm narrowing down the issue slowly and I hope I will get the answer today. |
I believe I found the root cause. There is a deduplication step which basically adds discovered templates to dictionary with template's identity as a key. Templates for net7.0 have still same identity name, so they replaced net6.0 templates. Line 13 in fca7c73
Changing identity to reflect new version should help. I can create PR for you, but I'm not sure this is only thing you want to modify. I see there is also |
Thanks! Looks like we should have updated that at the same time we updated branding - I'll push a PR for it & update our documentation. |
@wtgodbe is this blocked on dotnet/installer#13125? |
Yes, and that's blocked on dotnet/sdk#23597, which should get in once CI passes |
The PRs have all merged, so hopefully this is now fixed. |
Repro steps:
Expected Result
The project should be created successfully.
Actual Result:


dotnet --info

The text was updated successfully, but these errors were encountered: