如何使用输出类型控制台应用程序托管Web API?

问题描述:

你好,



请给我一个正确的解决方案。在1解决方案中,我有一个控制台应用程序,Web应用程序和web api,其输出类型是控制台应用程序。



我想在服务器上托管这个应用程序请告诉我如何在服务器上发布和托管。



我尝试了什么:



我对如何在服务器上托管我一无所知。

Hello,

Please provide me a correct solution. In 1 solution I have a console application, web application and web api whose output type is console application.

I want to host this application in a server please let me know how to publish and host on server.

What I have tried:

I am not getting any idea on how to host on server.

您只需要从任何托管服务提供商处购买订阅。有多个解决方案提供商为公司和个人提供竞争包。您可以从其中一个中进行选择。由于这是ASP.NET,我想说你应该去这里访问, ASP.NET Hosting | ASP.NET站点 [ ^ ]。首先来看看微软的云平台。还提供了其他第三方选项。



我还写了一篇文章,解释了如何在自己的机器上做到这一点,使用IIS和ASP.NET设置家庭服务器的简单指南 [ ^ ]。我使用本地网络来托管Web应用程序,您可以使用可以映射到Internet的静态IP地址。



另外正如评论中已经说过的那样,您只需要托管Web应用程序。控制台应用程序是您的Web API的客户端,它将通过适当的HTTP请求使用API​​。你不必担心这一点。您只需发布应用程序即可。阅读我分享的那篇文章,它会让你知道如何做到这一点。如果您打算获得第三方解决方案,他们可能会指导您完成设置。
You just need to purchase a subscription from any hosting provider. There are multiple solution providers that provide competing packages for the companies and individuals. You can select from one of them. Since this is ASP.NET, I'd like to say you should go and visit here, ASP.NET Hosting | The ASP.NET Site[^]. Start by having a look at Microsoft's cloud platform. There are other third-party options also provided along with.

I also wrote an article that explains how to do this on your own machines, A simple guide to setting up home server using IIS and ASP.NET[^]. I used a local network for hosting the web application, you can use a static IP address that can map to Internet.

Also as already said in the comments, you just need to host the web application. Console applications are the clients for your web API that would consume the API through proper HTTP requests. You don't need to worry about that. You just have to publish the application. Read that article that I have shared, it would give you an idea how to do that. If you are going to get a third-party solution, chances are that they will guide you through set up also.