IIS server connection problems after changing applicationUrl

0

I've set up a pretty basic API with .NET Entity framwework (basic weather forecast template). At the beginning everything was fine, the IIS server starts fine, but once I change the applicationUrl in the Json startup file, I get Failed to register URL "http://mywebsite:49892/" for site "API" application "/". Error description: Access denied. (0x80070005). In my hosts file I have set up mywebsite to my computer's IP, it works in the browser. After changing the URL back to http://localhost:49892 I get the same errors. In the output console of my API I can now see an output like that:

Successfully registered URL "http://localhost:49892/" for site "API" application "/"
Failed to register URL "https://mywebsite:44533/" for site "API" application "/". Error description: Access denied. (0x80070005)
Successfully registered URL "https://localhost:44353/" for site "API" application "/"
Registration completed for site "API"
IIS Express is running.

Is that normal that I get 3 lines of output instead of just 2? Why is it still registering localhost url instead of mywebsite? What might be causing the problem of the server failing to connect after ULR change?

.net
iis-express
asked on Stack Overflow Aug 13, 2020 by Ecuros • edited Aug 13, 2020 by Lex Li

1 Answer

0

If you are running your app with Visual Studio,did you also change the IP address in the Properties?I think that might be the problem since you changed the IP address in the .json file but the application still thinks you are using the old IP.For that you do left-click on your Application > Properties > Web and look for "Project Url".Check if the url is changed.

answered on Stack Overflow Aug 13, 2020 by AlexC

User contributions licensed under CC BY-SA 3.0