Changing a domain name from localhost to a custom name in Visual Studio

I'm new to MVC, and I just created one MVC4 test project in VS 2010, it works directly, but url http: // localhost: 60826 / I wanted to change it to http://my.test.site or at least http://my.test.site:60826/

I thought I could achieve this by simply placing an entry in a host file that will resolve my.test.site to 127.0.0.1, and then just change the URL to http://my.test.site:60826 . However, it does not work, am I missing something?

EDIT: I was able to achieve this by simply adding "my.test.site" to the proxy ignore list under "Internet Options" → "Connections" → "LAN Settings" → "Advanced" → "Exclusion List". I can now access http://my.test.site:60826/ from a browser. (Just in case, if you want VS to launch the page as http://my.test.site:60826/ , go to the URL of the project-property-web-start, add the URL there).

Now the next step is to get rid of this port number (60826), can anyone shed some light on how to run my application as ' http://my.test.site ' i.e. without any port number?

+4
source share
1 answer

Are you using IIS or IIS Express? If later you need to change the URL of the IIS project.

  • Right-click your web project.
  • Select Properties
  • In the Properties window, select the Web tab .
  • Specify the project URL :http://localhost:60826/
  • Provide application root Override URL: http://my.test.site:60826/
  • Click "Create a virtual directory" (you may need to run it as "Administrator").
  • Open: %USERPROFILE%\My Documents\IISExpress\config\applicationhost.config
  • in node, change your site to look like this:

    <site name="Lis.Portal.Web" id="11">
        <application path="/" applicationPool="Clr4IntegratedAppPool">
            <virtualDirectory path="/" physicalPath="C:\Users\**usernameHere**\PathToProjectHere" />
        </application>
        <bindings>
            <binding protocol="http" bindingInformation="*:60826:localhost" />
        </bindings>
    </site>
    
+1
source

Source: https://habr.com/ru/post/1605654/


All Articles