Delay between StructureMap.Start and Application_Start

0

Have a fairly large ASP.NET and classic asp site that takes an extremely long time for first page. ~45 seconds. I put in some AOP logging on eveyrhting i can get in my pipeline (poor mans profiling) and find a large gap between my structuremap.start and the application_start

    AOP Writes
    Time          What                                      Elapsed
    15:29:24.7537 RiPS.DependencyResolution.IoC.Initialize: 0.209 S
    15:29:24.7747 RiPS.DependencyResolution.StructureMapDependencyScope..ctor: 0 S
    15:29:24.7747 RiPS.DependencyResolution.StructureMapDependencyResolver..ctor: 0 S
    15:29:24.8407 RiPS.DependencyResolution.StructureMapDependencyScope..ctor: 0 S
    15:29:24.8407 RiPS.DependencyResolution.StructureMapDependencyResolver..ctor: 0 S
    15:29:24.8487 RiPS.App_Start.StructuremapMvc.Start: 0.308 S
    *15:29:24.8487* RiPS.App_Start.CustomErrorHander.PreStart: 0 S
    *15:29:42.0499* RiPS.MvcApplication..cctor: 0.001 S
    15:29:42.0499 RiPS.MvcApplication..cctor: 0.004 S
    15:29:42.0569 RiPS.MvcApplication..ctor: 0.002 S
    15:29:42.0569 RiPS.MvcApplication..ctor: 0.005 S
    15:29:43.2311 RipsMVC.Areas.Admin.AdminAreaRegistration..ctor: 0 S
    15:29:43.2311 RipsMVC.Areas.Admin.AdminAreaRegistration.get_AreaName: 0 S



    Manual Writes

    *15:29:24.8487* End Of StructureMapMVC.Start
    *15:29:42.0499* Beginning of MvcApplication ctor
    15:29:42.0569 Beginning of Application_Start
    15:29:46.4005 Beginning of MvcApplication ctor
    15:30:08.6163 Beginning of MvcApplication ctor

I put in some manual nLog logging in the two files of note

My Global.asax.cs

public class MvcApplication : System.Web.HttpApplication
{
    public MvcApplication()
    {
        LogManager.GetCurrentClassLogger().Trace("Beginning of MvcApplication ctor");
    }        
    protected void Application_Start()
    {
        LogManager.GetCurrentClassLogger().Trace("Beginning of Application_Start");

and structure map

 public static class StructuremapMvc {
    public static void Start() {
        IContainer container = IoC.Initialize();
        DependencyResolver.SetResolver(new StructureMapDependencyResolver(container));
        GlobalConfiguration.Configuration.DependencyResolver = new StructureMapDependencyResolver(container);
        LogManager.GetCurrentClassLogger().Trace("End Of StructureMapMVC.Start");
    }
}

I can't find out what if anything is happening between these two points in time. but its always more than 15 seconds.

I can't tell how verbose I am being so I welcome any requests for more information.

Additional info ---> Error that occurs Starting ASP.NET Site for development, I press F5 wait for the build to complete then have to count to 5 seconds or I get this error

=== Pre-bind state information ===
LOG: User = COBALT-PC\Mark
LOG: DisplayName = Ionic.Zip
 (Partial)
WRN: Partial binding information was supplied for an assembly:
WRN: Assembly Name: Ionic.Zip | Domain ID: 3
WRN: A partial bind occurs when only part of the assembly display name is provided.
WRN: This might result in the binder loading an incorrect assembly.
WRN: It is recommended to provide a fully specified textual identity for the assembly,
WRN: that consists of the simple name, version, culture, and public key token.
WRN: See whitepaper http://go.microsoft.com/fwlink/?LinkId=109270 for more information and common solutions to this issue.
LOG: Appbase = file:///C:/Users/Mark/Source/Repos/RiPS/RiPS/
LOG: Initial PrivatePath = C:\Users\Mark\Source\Repos\RiPS\RiPS\bin
Calling assembly : (Unknown).
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: C:\Users\Mark\Source\Repos\RiPS\RiPS\web.config
LOG: Using host configuration file: C:\Users\Mark\Documents\IISExpress\config\aspnet.config
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).
LOG: Attempting download of new URL file:///C:/Users/Mark/AppData/Local/Temp/Temporary ASP.NET Files/root/53450db4/7d786924/Ionic.Zip.DLL.
LOG: Attempting download of new URL file:///C:/Users/Mark/AppData/Local/Temp/Temporary ASP.NET Files/root/53450db4/7d786924/Ionic.Zip/Ionic.Zip.DLL.
LOG: Attempting download of new URL file:///C:/Users/Mark/Source/Repos/RiPS/RiPS/bin/Ionic.Zip.DLL.
LOG: Using application configuration file: C:\Users\Mark\Source\Repos\RiPS\RiPS\web.config
LOG: Using host configuration file: C:\Users\Mark\Documents\IISExpress\config\aspnet.config
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
LOG: Post-policy reference: Ionic.Zip, Version=1.9.1.8, Culture=neutral, PublicKeyToken=edbe51ad942a3f5c
ERR: Failed to complete setup of assembly (hr = 0x800700b7). Probing terminated.

If I do wait it takes 30 seconds to the First Page, regardless of which page I load. The second load is fast.

Its not always Ionic.Zip, any file in the solution can throw the error.

Also sometimes get the following error

Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
Compiler Error Message: CS1566: Error reading resource file 'c:\Users\Mark\AppData\Local\Temp\Temporary ASP.NET Files\root\8321fd63\20cbf3d0\ResX\resources.gridlocalization.nl-nl.resources' -- 'The system cannot find the path specified. '
asp.net
asp.net-mvc
asked on Stack Overflow Mar 14, 2013 by MarkKGreenway • edited Apr 11, 2013 by MarkKGreenway

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0