service-fabric
service-fabric copied to clipboard
[BUG] - Web Api Template scaffolding error in VS 2022 Community on Latest .NET SDK
Create web api project from scaffolding vanilla template error in VS 2022
Area/Component: Web Api Stateless Project
To Reproduce Attempt to create new project from vanilla template of VS 2022 Community with Latest .NET SDK in Windows 11
Expected behavior Able to successfully create stateless web api project
Observed behavior:
Screenshots
Service Fabric Runtime Version:
Environment:
- Dev cluster
- OS: Windows 11 Professional Latest
Additional context NA
Assignees: /cc @microsoft/service-fabric-triage
I found a workaround. create the project in VS 2019 and then dev through VS 2022
My workaround was to create as a .net 5 project, then upgrading to 6/7.
@ralav sorry for the delay in this being looked into. Unfortunatly this was not brough to my attention till over the weekend (I work on the relevant VS tools). For a quicker response in the future i recommend using the "Report a Propblem" feature in VS as that usually gets to the correct team faster:
I'm testing a fix for you issue, and it should be available in the 17.5 timeframe. In the meantime, an additional workaround to retargeting from .NET 5 is to uncheck "Do not use top-level statements" when making a .NET 6/7 web project:
Out template's code does not handle this new option (yet)
My workaround was to create as a .net 5 project, then upgrading to 6/7.
Never ever do manual efforts around this, as sometimes we will end up in loosing enhanced or ignored.
@ralav sorry for the delay in this being looked into. Unfortunatly this was not brough to my attention till over the weekend (I work on the relevant VS tools). For a quicker response in the future i recommend using the "Report a Propblem" feature in VS as that usually gets to the correct team faster:
I'm testing a fix for you issue, and it should be available in the 17.5 timeframe. In the meantime, an additional workaround to retargeting from .NET 5 is to uncheck "Do not use top-level statements" when making a .NET 6/7 web project:
Out template's code does not handle this new option (yet)
Thanks for the suggestion and regarding workaround I feel not okay. It's fine being package issue but expecting redundant.
@ralav A fix for this is available in Visual Studio 2022 17.5 Preview 2