How to access the. Net core 3.1 MVC web program running in LAN
Copyright Notice: This article is an original work licensed under the CC 4.0 BY-NC-ND license.
If you wish to repost this article, please include the original source link and this copyright notice.
Source link: https://v2know.com/article/487
1. Open the. Vs folder in the root directory of your project and find applicationhost.config
2. Modify the contents in <bindings></bindings>
Your original applicationhost.config may looks like this:
<bindings>
<binding protocol="http" bindingInformation="*:15485:localhost" />
<binding protocol="https" bindingInformation="*:44307:localhost" />
</bindings>
Change to:
<bindings>
<binding protocol="http" bindingInformation="*:15485:localhost" />
<binding protocol="http" bindingInformation="*:15485:192.168.3.142" />
<binding protocol="https" bindingInformation="*:44307:localhost" />
<binding protocol="https" bindingInformation="*:44307:192.168.3.142" />
</bindings>
Next, restart the project and run as an administrator.
At the same time, please pay attention to turn off the firewall in the LAN.
Of course, you can also add some LAN port rules, but this is not what I will teach in this tutorial.
The reason why I want to write this tutorial is that I want to actually visit the project I just finished with my mobile phone.
Directly, I don't want to configure IIS because it is too much trouble. This tutorial tells you that you can access it only in debug.
This article was last edited at 2020-10-25 09:06:29