Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to troubleshoot app domain shutdown due to "change in app_offline.htm", after editing file in Visual Studio?

Tags:

.net

asp.net

Every time I change a file in a web project in Visual Studio (.js, .css, .cshtml, whatever) my app domain immediately shuts down and restarts. The shutdown message (which I log) is "HostingEnvironment initiated shutdown / Change in App_Offline.htm"

This just started happening after months of normal development. I'm looking for an explanation, or suggestions for troubleshooting.

Relevant info:

  • This occurs after changing a file in the web project. I am NOT doing a compile.
  • ASP.NET MVC 3 with the T4MVC plugin
  • Occurs when I change a view or any content file [.js, .css] referenced by web project
  • Project is configured to use Visual Studio internal web server, but I am accessing the website via IIS. [Web site directory points to the web project directory on disk]
  • I do not have an app_offline.htm file, nor do I see one created for me
  • Files in /bin/ do not appear to be changed [timestamps don't change]
  • I am using NCrunch, but this still occurs with it disabled
  • This only occurs when I change a file in Visual Studio. Editing with text editor does not cause the app domain restart.

How do I figure out what Visual Studio is doing to cause this? This makes it very difficult to work on html/css/javascript, for obvious reasons.

like image 699
Seth Petry-Johnson Avatar asked Jan 20 '12 15:01

Seth Petry-Johnson


1 Answers

It appears that uninstalling and then re-installing T4MVC fixed the problem.

This might be relevant: a few days before I noticed this app domain restart issue, something happened and created a second T4MVC.cs file [called T4MVC1.cs]. This caused compilation errors from things being defined twice, and deleting the original T4MVC.cs file fixed that problem.

When I uninstalled and reinstalled the T4MVC package from nuget, I modified the web.csproj file and updated the <LastGenOutput> element to have a value of "T4MVC.cs".

I don't know if the issues with the generated file were related to the app domain restart issues, but after removing and reinstalling the T4MVC package and restarting Visual Studio the issue has gone away.

like image 62
Seth Petry-Johnson Avatar answered Nov 15 '22 03:11

Seth Petry-Johnson