Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
800 views
in Technique[技术] by (71.8m points)

visual studio 2010 - Make Localhost a Custom Domain in IIS Express

I am using IIS Express in Visual Studio 2010 and right now it runs on localhost:61156. But I need it to run on a domain. Is it possible to make IIS Express to run on devserver.com, instead of localhost:61156? So basically when I run debug I want devserver,com, instead of localhost:61156. I've come across a few things on google, but no luck. Any ideas on how to do this?

Thanks!

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Do the following

  1. If IIS Express is running stop it
  2. Open your webapplication project file (*.csproj or *.vbproj)
  3. Find <IISUrl>http://localhost:61156/</IISUrl> and change it to <IISUrl>http://devserver.com:61156/</IISUrl>
  4. Open %userprofile%documentsiisexpressconfigapplicationhost.config file

  5. Visual Studio 2015 now puts an applicationhost.config file specific to your project instead of using the global one. It is located at: /path/to/code/root/.vs/config/applicationhost.config

  6. Find your site entry in applicationhost.config file change the binding as shown below
    <binding protocol="http" bindingInformation="*:61156:devserver.com" />
  7. In Windowssystem32driversetchosts file add following mapping "127.0.0.1 devserver.com"
  8. In your browser add exception to bypass proxy for devserver.com
  9. Note that, since you are using custom domain (non localhost binding), you must run visual studio as Administrator

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...