I'm trying to debug my .net website locally through visual studio.
I can enter debug mode, but whenever I hit a part of the website that uses my web application, I get 404 errors.
When I publish to production(AWS EC2), everything works fine.
IIS is setup like this:
myWebSite [http://my_aws_ec2_instance]
Then I have a web application underneath that site:
myWebApplication [http://my_aws_ec2_instance/myWebApplication/]
My Visual Studio solution looks like this:
main project -- which is myWebSite
And the web application(myWebApplication) is a separate project.
I think it has to do with this line in my web.config:
<add key="webAppURL" value="http://my_aws_ec2_instance/myWebApplication/" />
As you can see, the key is pointing to the production site.
But I'm not sure what to change or what to change it to so that it works for both local debugging and production.
Thanks!
Change the value of the key "webAppURL" in the Web.config file of your web project. Insert the url of the local API running in your machine. To figure out which URL is, check the "Properties" panel of your web API project, click the tab "Web" and check the value of "Project Url":
To make it work for both local debugging and production you can apply a Web.config transformation.