简体   繁体   English

.NET API & IIS & 本地主机

[英].NET API & IIS & localhost

I have configure an API on Visual Studio using C# when I run the API it works.当我运行 API 时,我已经使用 C# 在 Visual Studio 上配置了 API。

I have tried to move the API over to my server, when I launch the API it says the following我试图将 API 移到我的服务器上,当我启动 API 时,它显示以下内容

info: Microsoft.Hosting.Lifetime[14] Now listening on: http://localhost:5000信息:Microsoft.Hosting.Lifetime[14] 现在收听:http://localhost:5000

And with that, I can only access this using http://localhost:5000 or http://127.0.0.1:5000 - I am unable to use my servers IP address( http://10.5.0.2:5000 ) or a domain name.这样,我只能使用 http://localhost:5000 或http://127.0.0.1:5000访问它 - 我无法使用我的服务器 IP 地址( http://10.5.0.2:5000 )或域名。

What advice can you give me.你能给我什么建议。

I have managed to solve the problem I uninstalled IIS(or some of it) and reinstalled it.我设法解决了我卸载 IIS(或其中一些)并重新安装的问题。

Deleted all my Sites and started fresh.删除了我所有的网站并重新开始。

When I ran the app it worked:-)当我运行该应用程序时它起作用了:-)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM