StructureMap.Start和Application_Start之间的延迟

时间:2013-03-14 19:37:51

标签: asp.net asp.net-mvc

有一个相当大的ASP.NET和经典的asp网站,第一页需要很长时间。 ~45秒。我把一些AOP记录在eveyrhting上,我可以进入我的管道(糟糕的mans profiling)并找到我的structuremap.start和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

我在注释

的两个文件中添加了一些手动nLog日志记录

我的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");

和结构图

 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");
    }
}

我无法确定这两点之间是否发生了什么。但它总是超过15秒。

我不知道我是多么冗长,所以我欢迎任何有关更多信息的请求。

其他信息--->发生错误 启动ASP.NET站点进行开发,我按F5等待构建完成然后必须计数到5秒或者我得到此错误

=== 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.

如果我等待,第一页需要30秒,无论我加载哪个页面。第二次加载很快。

它并不总是Ionic.Zip,解决方案中的任何文件都会抛出错误。

有时也会出现以下错误

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. '

0 个答案:

没有答案