Hello @Thibaut Bournonville ,
Welcome to Microsoft Q&A forum.
Are you using any extension? Did you change any VS settings?
Please try following methods:
- Close VS, open VS Installer, select Modify, uncheck ".NET desktop development" workload, click Modify, check it again and click Modify again to reinstall ".NET desktop development" workload.
- Try to install "ASP.NET and web development" workload and check if the publish option appears.
- Reset VS settings by opening(type and search in Windows Search box to open it) Developer Command Prompt for Visual Studio 2022 and run
devenv /ResetSettings
command. - Try to create a new C# Console application, but let it base on .NET Framework, check if the Publish option is available.
Workaround: try to use dotnet CLI to publish your project. If above methods don’t work, you may open a command line tool, for example CMD, and use command like cd C:\MyFirstProject
, dotnet publish
, or configure the .pubxml file(create one and customize it), then use dotnet publish -p:PublishProfile=MyPublishProfile
to publish your project as a temporarily workaround(see this document: dotnet publish for more details).
Update1:
If this issue still occurs, please try to update Visual Studio 2022 to the latest version and reinstall the .NET desktop development workload, then create a new project and test again.
Best Regards,
Tianyu
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.