如何自我托管我的ASP.NET应用程序? [英] How do I self hosting my ASP.NET app ?

查看:84
本文介绍了如何自我托管我的ASP.NET应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在家里自己托管我的ASP.Net应用程序。我的应用程序很简单,电影数据库。

但是我无法让这个应用程序联机到网上。就像我的工作一样,我可以访问网站并在数据库中添加或删除电影。



我在网上看到了一个Pre-Build电影数据库但是在视觉上Studio我只能在'localhost:1234'上发布网站。

我怎样才能使这个应用程序在线上网,而不仅仅是我的家庭网络。



我尝试了什么:



我在Windows上尝试过Web管理工具但没有成功..

I wanted to self hosted my ASP.Net app at home. My app is very simple, Movie Database.
But i'm unable to make this app reach online. Like im a the job and i can access to the website and add or remove a movie from the database.

I saw online a Pre-Build movie database but on Visual Studio I can only publish the website on 'localhost:1234'.
How can i make this app reach online, not only my home network.

What I have tried:

I have tried the Web Management Tools on Windows but with no success..

推荐答案

I认为你在这里为自己设置真正的问题,但从理论上来说,它相当简单:使用OWIN自行托管ASP.NET Web API 2 Microsoft Docs [ ^ ]



但我会这样做吗?不,甚至没有。如果只是因为你需要一个域来使它成为一个适当的网站(如果你没有域名,你将不得不通过IP地址访问它,所以你需要确保你的家庭互联网提供商给你一个静态IP地址,或者每次路由器重置时它都会改变。



我?我找到便宜的(如果你不介意的话,甚至是免费的)你通过他们的托管服务得到的麻烦 - 他们中的许多人也将免费为你注册你的domiona - 并使用他们的IIS服务器,数据库服务器,几乎肯定也可以获得与域名相关的电子邮件。
I think you are setting yourself up for real problems here, but in theory it';s reasonably simple: Use OWIN to Self-Host ASP.NET Web API 2 | Microsoft Docs[^]

But would I do it? No. Not even slightly. If only because you need a domain to make it a "proper" website (if you don't have one you will have to access it via an IP address instead, so you will need to make sure that your home internet provider has given you a Static IP address or it will change each time your router is reset.

Me? I'd find a cheap (or even free, if you don't mind the hassle you get with 'em) hosting service - many of them will register your domiona for you for free as well - and use their IIS server, database server, and almost certainly get domain related emails as well.


您需要了解您的网站可以到达哪个IP地址,有免费服务,如我的IP地址是什么?网络工具和放大器;更多 [ ^ ]可以向您展示。

您可能还需要检查路由器设置,看看是否有阻塞访问。

如果它仍然无效,请检查您的提供商,有些不允许这种访问。



A警告:使用暴露在互联网上的自托管应用程序并不是一个好主意,请参阅此处的文章以获得解释: ASP.NET Core中的Kestrel Web服务器实现Microsoft Docs [ ^ ]
You need to find out on what ip address your website can be reached, there are free services like What's My IP Address? Networking Tools & More[^] that can show you this.
You probably also need to check your router settings and see if nothing is blocking access.
If it still won't work, check your provider, some don't allow this kind of access.

A word of warning: using a self hosted application exposed to the internet is not exactly a good idea, see article here for an explanation: Kestrel web server implementation in ASP.NET Core | Microsoft Docs[^]


完美,



谢谢你,我真的很感激你的建议,谢谢你帮助我。
Perfect,

Thanks you, I really appreciate your advice and thanks you help me out.


这篇关于如何自我托管我的ASP.NET应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆