I'm trying to understand what is going on in my app. For the reference I'm running iisexpress.exe x64 and .NET 4.5.2 using ASP.NET MVC. I'm looking at the debug logs in the output window in visual studio and I see a lot of this:
'iisexpress.exe' (CLR v4.0.30319: /LM/W3SVC/2/ROOT-16-131251630950625500): Unloaded 'C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\7bed87d2\52db2cb\assembly\dl3\e1b2ad06\364709ab_1e4cd201\VolsImpl.dll'
'iisexpress.exe' (CLR v4.0.30319: /LM/W3SVC/2/ROOT-16-131251630950625500): Unloaded 'C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\7bed87d2\52db2cb\assembly\dl3\56a80de6\c1b89b0f_f641d201\WebGrease.dll'
'iisexpress.exe' (CLR v4.0.30319: /LM/W3SVC/2/ROOT-16-131251630950625500): Unloaded 'C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\7bed87d2\52db2cb\assembly\dl3\988eb89c\006135f2_2c44d201\WPFToolkit.dll'
'iisexpress.exe' (CLR v4.0.30319: /LM/W3SVC/2/ROOT-16-131251630950625500): Unloaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Runtime\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Runtime.dll'
And then maybe, 5 seconds later, this:
'iisexpress.exe' (CLR v4.0.30319: /LM/W3SVC/2/ROOT-18-131251631350325466): Loaded 'C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\7bed87d2\52db2cb\assembly\dl3\176bb93b\80e4a580_2544d201\adppmdlnetwrap.dll'. Cannot find or open the PDB file.
'iisexpress.exe' (CLR v4.0.30319: /LM/W3SVC/2/ROOT-18-131251631350325466): Loaded 'C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\7bed87d2\52db2cb\assembly\dl3\3e610582\807a1250_2644d201\alglibnet2.dll'. Module was built without symbols.
'iisexpress.exe' (CLR v4.0.30319: /LM/W3SVC/2/ROOT-18-131251631350325466): Loaded 'C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\7bed87d2\52db2cb\assembly\dl3\5c17d607\596fc1a6_1e4cd201\AmericanOption.Test.dll'. Symbols loaded.
'iisexpress.exe' (CLR v4.0.30319: /LM/W3SVC/2/ROOT-18-131251631350325466): Loaded 'C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\7bed87d2\52db2cb\assembly\dl3\53755cf8\8ce4c1a6_1e4cd201\AmericanOptionImpl.dll'. Symbols loaded.
'iisexpress.exe' (CLR v4.0.30319: /LM/W3SVC/2/ROOT-17-131251631150955531): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_64\System.Data.OracleClient\v4.0_4.0.0.0__b77a5c561934e089\System.Data.OracleClient.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'iisexpress.exe' (CLR v4.0.30319: /LM/W3SVC/2/ROOT-18-131251631350325466): Loaded 'C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\7bed87d2\52db2cb\assembly\dl3\05434ba9\152b6c2d_f641d201\Antlr3.Runtime.dll'. Symbols loaded.
'iisexpress.exe' (CLR v4.0.30319: /LM/W3SVC/2/ROOT-18-131251631350325466): Loaded 'C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\7bed87d2\52db2cb\assembly\dl3\ac1f38f5\801cf661_2a44d201\Apache.NMS.ActiveMQ.dll'. Cannot find or open the PDB file.
'iisexpress.exe' (CLR v4.0.30319: /LM/W3SVC/2/ROOT-18-131251631350325466): Loaded 'C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\7bed87d2\52db2cb\assembly\dl3\02a1ee63\8000a853_2a44d201\Apache.NMS.dll'. Cannot find or open the PDB file.
'iisexpress.exe' (CLR v4.0.30319: /LM/W3SVC/2/ROOT-18-131251631350325466): Loaded 'C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\7bed87d2\52db2cb\assembly\dl3\efc156d2\b33537c7_451fd201\AutoMapper.dll'. Cannot find or open the PDB file.
I know the assemblies I have there are different and some come from different places like the GAC or asp.net temporary files. But why is this happening? It's incredibly slow debugging my app because of all the assemblies being loaded and then unloaded. I understand there is something called 'lazy loading' that only loads .dlls when they are needed .etc, but these are just seemingly senselessly being loading and unloaded.
Anywhere I can read up on this? Or is something wrong with my app?
Thanks!
EDIT: I notice this is similar to the problem listed here: ASP.NET MVC on IISExpress rebuilding entire site for each request and here: IIS Express loads and unloads modules for each request
In fact, it seems that the app domain is constantly being torn down and recreated at every web request. You can see here:
'iisexpress.exe' (CLR v4.0.30319: Domain 3): Unloaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_64\mscorlib\v4.0_4.0.0.0__b77a5c561934e089\mscorlib.dll'
'iisexpress.exe' (CLR v4.0.30319: /LM/W3SVC/2/ROOT-2-131251647881676169): Unloaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_64\System.Web\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Web.dll'
'iisexpress.exe' (CLR v4.0.30319: /LM/W3SVC/2/ROOT-2-131251647881676169): Unloaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System\v4.0_4.0.0.0__b77a5c561934e089\System.dll'
But I can get all the way up to Domain 20.
EDIT: my Application_Start() :
protected void Application_Start()
{
// Disable connections
Environment.SetEnvironmentVariable("MFL_NO_CONNECTIONS", "true", EnvironmentVariableTarget.Process);
Mfl.User.SystemTools.InitializeMfl();
// Register all the mappings from domain/presentation in the whole app.
AutoMapperConfig.RegisterMappings();
AreaRegistration.RegisterAllAreas();
FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
RouteConfig.RegisterRoutes(RouteTable.Routes);
BundleConfig.RegisterBundles(BundleTable.Bundles);
log4net.Config.XmlConfigurator.Configure(new FileInfo(Server.MapPath("~/Web.config")));
// Add support for inheritance model binding for Request Data and Editing Notes
ModelBinders.Binders.Add(typeof(BaseRequestDataViewModel), new InheritanceModelBinder());
ModelBinders.Binders.Add(typeof(NoteTemplateViewModel), new InheritanceModelBinder());
// Add support for ExpressiveAnnotations for more complex validation rules
ModelValidatorProviders.Providers.Remove(
ModelValidatorProviders.Providers
.FirstOrDefault(x => x is DataAnnotationsModelValidatorProvider));
ModelValidatorProviders.Providers.Add(
new ExpressiveAnnotationsModelValidatorProvider());
}