We are on Visual Studio Pro 2019, so I need to convert a project from .NET 5 to .NET Framework 4.7.2. Using this post, I was able to make the project recognize the framework version. I tried both styles, but only the second worked:
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<TargetFramework>net472</TargetFramework>
I'm getting an error when implementing it:
Error NETSDK1013
The TargetFramework value '' was not recognized. It may be misspelled. If not, then the TargetFrameworkIdentifier and/or TargetFrameworkVersion properties must be specified explicitly. ProjectName C:\Program Files\dotnet\sdk\5.0.411\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.TargetFrameworkInference.targets 92
I assume that it should be pointing to a different SDK altogether based on the file path, but I haven't found anywhere in the project or solution that does that.
It would be nice to also be able to use the old framework style of publishing as well, but I would prefer not to have to start with a new project if I can help it.