3

My organisation recently did a hardware refresh, so all software (VS 2013 etc) is newly installed.

Now we are all noticing a particular ASP.NET MVC 4.5 application is running extremely slow.

Took me a while to notice this, but in the output while debugging the first entry after each request is

'iisexpress.exe' (CLR v4.0.30319: Domain 11): Unloaded 'C:\Windows\Microsoft.Net\assembly\GAC_32\mscorlib\v4.0_4.0.0.0__b77a5c561934e089\mscorlib.dll'

After this entry, it shows iisexpress loading up hundreds of .NET dlls.

For the next request it will become Domain 12, and then hundreds of dll loaded entries again.

Other applications are always DefaultDomain, and have no performance issues.

Is there a setting somewhere that is controlling this?

Edit - more info: The very first request is DefaultDomain, then it starts incrementing from Domain 10.

A previous version of this app on MVC 4.0 is working fine.

One major addition between versions is microsoft owin.

Logged event happens on each request - Event message: Application is shutting down. Reason: Configuration changed, however no files have actually changed in the dev folder. Temp ASP.NET folder is getting rebuilt each time.

kim
  • 71
  • 9

1 Answers1

0

There are ways to log the reason why the app domain shutdown happened:

http://blogs.msdn.com/b/tess/archive/2008/11/06/troubleshooting-appdomain-restarts-and-other-issues-with-etw-tracing.aspx

FarmerBob
  • 1,314
  • 8
  • 11
  • The application's folder in Temp ASP.NET Files is being recreated each request, however no files are modified in the actual application folder in my dev folder. – kim Oct 02 '14 at 01:35
  • So it's not merely app domain restarting, it's actually recompiling. Have you followed the instructions in the link to find out the reason? – FarmerBob Oct 02 '14 at 02:29
  • I'm getting this - Application is shutting down. Reason: A subdirectory in the Code application directory was changed or renamed, but no changes have been made in the application's folder. – kim Oct 02 '14 at 06:18
  • Ok, I assumed that the "Code" directory is referring to App_Code, and deleted the single cshtml out of there. Things have improved - two domains get created on initial start up, but no more subsequent recompiles. I'll need to do more digging since this problem only occurred after a machine rebuild. – kim Oct 02 '14 at 06:53
  • Use Procmon http://technet.microsoft.com/en-us/sysinternals/bb896645.aspx to find out why its changing. – FarmerBob Oct 02 '14 at 06:57
  • Yeah, tried that. I know that its that view under App_Code that is causing the issue, but I dont know why IISExpress thinks its changing. – kim Oct 03 '14 at 03:49
  • 1
    I created a brand new MVC site and added App_Code folder, and it displays the same symptoms. IISExpress seems to be the culprit that changes the file, but it is not really changing anything. It is the only process accessing the file, attr "ChangeTime" in procmon has changed but Modified Date in file explorer hasnt changed. – kim Oct 03 '14 at 04:18
  • This'll make you laugh, six years later! My nlog.config file was pointing to a log file in the bin directory :-) – mwardm Jan 23 '20 at 23:56