I have a .Net Core 3.1 C# project that is and has always been a Console Application, but all of a sudden Visual Studio claims that it is a Windows Application and I cannot change it (or rather, I can change it but Visual Studio changes it back to Windows Application").
I've been working on this project for a long time and have had no problems, but suddenly I cannot publish the project any more.
Some more details:
- The project have both Windows and Mac as targets and I have two publish profiles; one for Windows (win10-x64) and one for Mac (osx.10.12-x64).
- As mentioned above the output type is/should be Console Application.
- I've had no problems publishing with both profiles before.
- I might have done a Visual Studio update but I can't really remember. (Using Community 2019, version 16.8.1 now)
When I now try to publish for PC, I get the error message "There was no runtime pack for Microsoft.WindowsDesktop.App.WindowsForms available for the specified RuntimeIdentifier 'osx.10.15-x64'.", something that is extremely odd since it isn't a WindowsDesktop application, it isn't using WindowsForms and it shouldn't bother about osx versions when I publish to PC (and in addition - I have specified osx.10.12-x64, not osx.10.15-x64 for Mac).
Further investigation shows that the RuntimeIdentifiers tag in the project file somehow is changed to now reference osx.10.15-x64 and not osx.10.12-x64 that I did specify. And in addition there is the problem that I cannot change output type to Console Application. If I do that change, close the properties window and open it again it is back to Windows Application.
I can build the project, but not publish it. What the f.. is going on???