我使用的 .NET版本是2.2, VS 2019。
使用VS 自动生成的 .NET Core Web项目后,在Properties中有launchSettings.json这个文件,里面已经写好了配置端口的内容:
{
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:14878",
"sslPort": 0
}
},
"profiles": {
"IIS Express": {

本文介绍了如何在使用.NET版本2.2和VS 2019的环境中,为ASP .NET Core Web应用程序指定端口。通过修改项目中的配置文件,将localhost更改为0.0.0.0,可以实现外网访问。
最低0.47元/天 解锁文章
253

被折叠的 条评论
为什么被折叠?



