C# Web - localhost:port works, 127.0.0.1:port doesn't work

前端 未结 7 769
你的背包
你的背包 2021-02-01 01:48

I just finished adding C# Web API components (Web API Models & Controllers) to a localhost copy of an existing project.

This Web API\'s GET-methods shou

7条回答
  •  太阳男子
    2021-02-01 02:42

    In visual studio 2015 with IIS express: first in project properties change project url from http://localhost:(Port No) to : http://127.0.0.1:(Port No)

    and click on Create Visual Directory

    then go to your solution path and open ".vs" dirctory (directory is hidden) and open "applicationhost.config"

    
            
                
                    
                
                
                    
                
            
            
                
                    
                
                
                    
                
            
            
                
                    
                
                
                    
                
            
            
                
                
            
            
            
        
    

    and change last binding section of your web app from *:(Port No):localhost to *:(Port No):127.0.0.1

    and stop all running project on IIS Express and restart them.

提交回复
热议问题