问题
Spend a lot of time looking for this one, here what I've found so far:
Change default iis express port
change default iis for web application
I have a web site in visual studio 2015 (aspx) I want to change the default port. No way to do it. Here are some hints - that used to work, or works for web application but this is not the case. no csproj file, changing applicationhost.config did not help either.
回答1:
Do a File-Search for files containing that port number. Doing so yielded these results for me:
.sln file - VWDPort seems like the most important one
.sln file - 3 results found Virtual Directory setup, which probably doesn't matter as much, but I changed that also. It looks like ...\localhost_[portNumber]
applicationhost.config - specifies 2 places with binding to *.[portNumber]:localhost
VWDPort may be the only one required, but I changed those I found anyway.
回答2:
Port number is specified in applicationhost.config, but there are two verions of this file - one system-wide and one per-user.
The file you need to change is at this location:
%userprofile%\documents\IISexpress\config\applicationhost.config
来源:https://stackoverflow.com/questions/36769854/change-default-port-for-iis-express-visual-studio-2015-for-web-site-project