AspNetCore.Docs icon indicating copy to clipboard operation
AspNetCore.Docs copied to clipboard

Class "WebApplication" not found

Open mdc88 opened this issue 3 years ago • 4 comments

Following instructions exactly as is, the class WebApplication is not found.
[Enter feedback here]


Document Details

⚠ Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.


Associated WorkItem - 100183

mdc88 avatar Jun 14 '23 01:06 mdc88

What version(s) of .NET do you have installed? Are you using Visual Studio or the CLI? If VS, what workloads do you have installed?

tdykstra avatar Jun 14 '23 17:06 tdykstra

I’ve actually tried it with both CLI and VS new project.  Both end up with same result.  Only solution I’ve seen so far is to change the Project SDK in the csproj file.  Sent from my iPhoneOn Jun 14, 2023, at 10:48 AM, Tom Dykstra @.***> wrote: What version(s) of .NET do you have installed? Are you using Visual Studio or the CLI? If VS, what workloads do you have installed?

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: @.***>

mdc88 avatar Jun 14 '23 19:06 mdc88

@mdc88 I ran into the same issues. There is something very broken about this setup as the AspNetCore.App framework isn't installed as part of the Worker SDK and all of the nuget packages are marked as deprecated.

I managed to get it working by changing the Sdk setting at the top of the project file to <Project Sdk="Microsoft.NET.Sdk.Web">

I am unsure of the impact of this change and whether the project will still run as a worker service or not but in my early testing it appears to still run background tasks alongside hosting a web api (which I basically copied the various sample files and references from the Web API template)

DenisPitcher avatar Jun 16 '23 17:06 DenisPitcher

This issue has been automatically closed due to no response from the original author. Feel free to reopen it if you have more information that can help us investigate the issue further.