vs调试模式通过ip访问web站点

vs默认调试模式,打开站点以localhost开头访问网站,如果换成ip+端口号则会报以下错误,

Bad Request - Invalid Hostname

解决办法:

在项目目录文件.vs/config路径下,编辑applicationhost.config文件,增加一行代码:

 

 
                
                    
                
                
                    
					
                
            

这样重新访问网站,通过ip+端口访问是没问题的。

你可能感兴趣的:(C#,Web,c#,visual,studio,.net,asp.net)