Change Project URL Visual Studio

后端 未结 2 937
耶瑟儿~
耶瑟儿~ 2020-12-31 09:38

I would like to be able to debug my ASP.NET MVC application on a domain other than localhost as well as any subdomains, in other words:

http://domain.dev http://*.do

2条回答
  •  清酒与你
    2020-12-31 10:01

    You need to actually create a new record for each subdomain in the hosts file. You can't use wildcards.

    127.0.0.1 domain.dev
    127.0.0.1 foo.domain.dev
    127.0.0.1 bar.domain.dev
    

    Although it seems that it can be done with some extra work, see this question for more details.

    You also need to include the port number when accessing the URL. The browser would point to http://foo.domain.dev:0000, using the port number assigned in VS, of course.

    If you are using the Visual Studio Development Server, that's all there is to it. If using IIS Express, it takes a bit more work.

    VS project properties

    Then you need to make sure you have a record in the IIS applicationhost.config file :

    
        
            
        
        
            
        
    
    

    Update

    
        
            
        
        
            
            
        
    
    

提交回复
热议问题