0

When I create Visual Basic or C# windows forms application everything runs as expected. However the Build Menu Publish option now list Publish Selection rather than Publish [App Name]: enter image description here In addition the Properties page for the application in not in the expected format. Like this: enter image description here

Rather than expected like this: enter image description here and it no longer includes the expected target frameworks (.NET Framework 4.7.2) or Application types (Windows Forms Application).

The publish process uses an unfamiliar interface and does not create the setup.exe and related files.

I tried to find a difference in any setting between existing projects and the new ones but could find nothing.

PKanold
  • 139
  • 7
  • _I tried to find a difference in any setting between existing projects and the new ones but could find nothing_: You couldn't find ANY difference? One is .NET 6.0 and the other is .NET Framework 4.7.2. – Tu deschizi eu inchid Jan 16 '23 at 22:19
  • 1
    You selected a `Windows Forms App` Project template, not a `Windows Forms App (.NET Framework)` template when you created the Solution in VS 2022. Then you have the new interface, which handles the new Project format. You can only target .NET Core or .NET here. The *selection* refers to the starting Project of the Solution. The new Publish interface only creates a profile for publishing, you have to commit it after you're done configuring it – Jimi Jan 16 '23 at 22:24
  • 2
    You may want to read these: [Deploy .NET Core apps with Visual Studio](https://learn.microsoft.com/en-us/dotnet/core/deploying/deploy-with-vs?tabs=vs156) -- [Publish a .NET console application using Visual Studio](https://learn.microsoft.com/en-us/dotnet/core/tutorials/publishing-with-visual-studio?pivots=dotnet-7-0) (and what's on the left side menu of both documents) – Jimi Jan 16 '23 at 22:25
  • To elaborate on what Jimi said, you decide whether to target .NET Framework or .NET Core (.NET 5 and later are based on .NET Core) when you select the project template. All those that target .NET Framework say so in the name. If the name doesn't include ".NET Framework" then you're targeting .NET Core. .NET Core was built from the ground up to address some of the short-comings of .NET Framework. It includes most of the same functionality and some new, but there are also some omissions. If you're unsure, you should do some reading on the topic. – jmcilhinney Jan 16 '23 at 23:57

1 Answers1

2

These two application projects face different platforms.

One is the .Net Framework framework, which is mainly applicable to the windows platform.

One is the .Net core framework platform, which is suitable for cross-platform.

When you create a new program, .Net Framework will specifically mark for example:

enter image description here

For .Net core publishing, as Jimi said, you can refer to Tutorial: Publish a .NET console application using Visual Studio.

For .Net core and .Net Framewokr, you can also refer to this issue.

Jiale Xue - MSFT
  • 3,560
  • 1
  • 6
  • 21