service-fabric icon indicating copy to clipboard operation
service-fabric copied to clipboard

[BUG] - Web Api Template scaffolding error in VS 2022 Community on Latest .NET SDK

Open mraipsec-mra opened this issue 2 years ago • 1 comments

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 image

Service Fabric Runtime Version: image

Environment:

  • Dev cluster
  • OS: Windows 11 Professional Latest

Additional context NA


Assignees: /cc @microsoft/service-fabric-triage

mraipsec-mra avatar May 22 '22 23:05 mraipsec-mra

I found a workaround. create the project in VS 2019 and then dev through VS 2022

mraipsec-mra avatar May 25 '22 18:05 mraipsec-mra

My workaround was to create as a .net 5 project, then upgrading to 6/7.

tyler-kearney-pu avatar Nov 14 '22 14:11 tyler-kearney-pu

@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: image

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: image Out template's code does not handle this new option (yet)

NCarlsonMSFT avatar Nov 15 '22 00:11 NCarlsonMSFT

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.

mraipsec-mra avatar Nov 19 '22 04:11 mraipsec-mra

@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:

image

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:

image

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.

mraipsec-mra avatar Nov 19 '22 04:11 mraipsec-mra

@ralav A fix for this is available in Visual Studio 2022 17.5 Preview 2

NCarlsonMSFT avatar Dec 16 '22 19:12 NCarlsonMSFT