top | item 30658743

(no title)

jkulubya | 4 years ago

ASP.NET Core apps are actually straightforward console applications. In fact most of the application types you’ll run on .net core are configured in a main method in program.cs. The answer to your specific questions about mixing different services in one app will be some combination of the following links.

https://khalidabuhakmeh.com/hosting-two-aspnet-core-apps-in-...

https://docs.microsoft.com/en-us/aspnet/core/fundamentals/ho...

https://docs.microsoft.com/en-us/aspnet/core/fundamentals/ho...

discuss

order

luuio|4 years ago

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

dahauns|4 years ago

But those are just sets of convenient defaults? You could just start with the default sdk and add the imports/targets yourself (or in practice: let the IDE do it for you.)

And

>- If you switch the project to Sdk=...Web, you won't have the dependencies to build the worker services.

Yes you will, since the worker sdk is simply a subset of the web sdk.

spaetzleesser|4 years ago

That’s the problem. You have to read multiple articles to achieve simple things.

jkulubya|4 years ago

The original poster is going slightly off the beaten path and therefore has to manually compose three or four different concepts together to come to the right solution vs relying on the out of the box experience.

I, and a lot of other devs, would be able to solve this particular problem without looking up the docs but I can’t assume any knowledge on the poster’s behalf so I posted the links to the docs about the building blocks and an article showing one possible way of composing them.

The same exact problem as posed by the poster was thought of by the dotnet/aspnet teams and the pieces (apis/docs/samples) are all there, just not the default.

DeathArrow|4 years ago

Well how would you do it if another platform if you are a beginner. Because I am a beginner in Rust, this is the process I would use:

1. search Google, read few articles or posts

2. write code

3. make it compile

4. encounter bugs

5. research the bugs on yet other articles or posts

6. fix the bugs

7. ???

8. profit!