`<TargetFramework>netcore5.0</TargetFramework>` gives a gold bar
See original GitHub issueVisual Studio Version: 16.9.0 Preview 3 [30828.3 main]
Summary:
Change the project to have <TargetFramework>netcore5.0</TargetFramework>
and you get an error that could be more helpful?
Steps to Reproduce:
- Create a regular C# .NET Core project.
- Double click on project, edit the TFM to any of these
<TargetFramework>netcore6.0</TargetFramework>
<TargetFramework>blah</TargetFramework>
–> you get nice errors in the error list like NETSDK1013 The TargetFramework value 'blah' was not recognized. It may be misspelled. If not, then the TargetFrameworkIdentifier and/or TargetFrameworkVersion properties must be specified explicitly.
which is what I expect
- Edit it to
<TargetFramework>netcore5.0</TargetFramework>
Now you get a gold bar The project 'ConsoleApp13' ran into a problem during the last operation: The expression "[System.Version]::Parse('')" cannot be evaluated. Version string portion was too short or too long. C:\Program Files\dotnet\sdk\5.0.200-preview.20614.14\Sdks\Microsoft.NET.Sdk\targets\Microsoft.PackageDependencyResolution.targets You may need to reload the solution after fixing the problem.
The message isn’t ideal, but that probably comes from the .targets – the reason I’m logging it is that I wouldn’t expect a gold bar so maybe something’s wrong with the project system.
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (4 by maintainers)
Top GitHub Comments
I took a look and there is some specific code for a netcore50 TFM that was used a few years back for UAP10.0 applications. That TFM is deprecated. I could try to conditional the specific line causing the error but customers would still end up with error MSB3644. I could try to get make NETSDK1013 more restrictive but that would have to account for netcore5.0 being a valid TFM from a few years ago so I’m not sure how to best handle that.
So ultimately, it’s probably not worth fixing this at this time. We can reactivate if we get more feedback from customers who are doing netcore by mistake.
Got it.