Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
mraipsec-mra opened this issue May 22, 2022 · 6 comments
Labels

Comments

@mraipsec-mra
Copy link

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 mraipsec-mra added the type-code-defect Something isn't working label May 22, 2022
@mraipsec-mra
Copy link
Author

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

@ghost ghost added the status-last6months label Sep 8, 2022
@tyler-kearney-pu
Copy link

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

@NCarlsonMSFT
Copy link
Member

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

@mraipsec-mra
Copy link
Author

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
Copy link
Author

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

@NCarlsonMSFT
Copy link
Member

NCarlsonMSFT commented Dec 16, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants