|
|
|
|
|
by useerup
1561 days ago
|
|
I did. It works. The above code lines are cut directly from a test project that I made. Several people have pointed out how a web app in .NET 5/6 is really a console app which only starts a web server configured with an application and waits for it to complete (i.e. shut down). It really is that simple. |
|
When I said console app, I literally meant using the project that you would create if you do `dotnet new console`.
To copy from my other comment:
That is exactly the thing. I do not want to have the Sdk=...Web/Worker. Imagine this scenario, you started a new project with the Sdk targeting Worker. Then you need that binary to also target web. What do you do?
- If you switch the project to Sdk=...Web, you won't have the dependencies to build the worker services.
- If you keep it as Sdk=...Worker, you won't have the dependencies to build asp.net