I have an issue every time I update my ASP.NET application on my IIS server. The issues are:
- I get an error telling me to turn custom errors off
<customErrors mode="Off"/>
- The default web site redirect at the TLD redirects the URL indefinitely
- I created removed and replaced the App or the redirect
I have an ASP.NET 4.5 Framework application. I am using Visual Studio 2012 to create the web application. I am using Windows Server 2008 R2 64 bit, with the IIS 7 role installed. Every last option for the IIS role was checked and installed.
Once IIS is up and running, I created a directory in C:\inetpub\wwwroot and put my published ASP.NET app in the directory that I created. I then added the app via IIS manager.
After that I can browse to my app from www.example.com/app. The current app is working. Since I want anyone who types in my TLD in the web browser to be redirected, I created an HTTP redirect via IIS manager under Default Web Site. It creates a web.config
file in C:\inetpub\wwwroot with the redirect in it.
After all of this is done everything works great. That is until I want to update the ASP.NET code. I delete the old files from C:\inetpub\wwwroot\app and copy in the new files. After that nothing works right anymore. I have tried to remove the app via IIS then re-adding it. I even removed the http redirect, and then re-added it. No matter what I do the root of my site www.example.com and the web app won't work. I have to remove the IIS role and reinstall it. Once I do that the current code works, and everything is back to normal.
Can someone please tell me how I can update my code with having to reinstall IIS every time?