0

有一个相当大的 ASP.NET 和经典的 asp 站点,它的首页需要很长时间。约 45 秒。我在我的管道中添加了一些 AOP 日志记录(可怜的 mans 分析),并发现我的 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. '
4

0 回答 0