简体   繁体   English

asp.net网站(开发)第一次加载需要很长时间(C#/ Visual Studio 2012)

[英]asp.net website (development) takes very long to load first time (C# / Visual Studio 2012)

I know this has been asked quite some time regarding production websites. 我知道有很多关于制作网站的问题。 However, I would like to know if there is anything that could possibly be done to speed up the initial load time of a website, during development. 但是,我想知道在开发过程中是否还有什么可以加快网站的初始加载时间。 I've been timing it and it takes up to 50seconds to load the initial homepage. 我一直在计时,加载初始主页需要50秒。 Subsequent loads take only 1 - 3seconds. 后续加载仅需1 - 3秒。 Also, when I 'break' the execution, it does not stop at any location in the code but just says 'No source code found'. 此外,当我'中断'执行时,它不会停在代码中的任何位置,而只是说'找不到源代码'。

The output window lists a lot of: 输出窗口列出了很多:

'iisexpress.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\0a486d18\8cf9a7c5\App_Web_scrollablecontent.ascx.fdc5856b.1gwjfghw.dll', Symbols loaded.
'iisexpress.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\0a486d18\8cf9a7c5\App_Web_newarticles.ascx.44e66049.4ezrpblb.dll', Symbols loaded.
'iisexpress.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\0a486d18\8cf9a7c5\App_Web_rightcolumnmediumrectangleadvert.ascx.57649735.kymbya94.dll', Symbols loaded.
'iisexpress.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\0a486d18\8cf9a7c5\App_Web_main.master.cdcab7d2.lei5axii.dll', Symbols loaded.
'iisexpress.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\0a486d18\8cf9a7c5\App_Web_articleheadline.ascx.c8a8415c.klhhkoqx.dll', Symbols loaded.
'iisexpress.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\0a486d18\8cf9a7c5\App_Web_articleheadlines.ascx.c8a8415c.ikuqn1xd.dll', Symbols loaded.
'iisexpress.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\0a486d18\8cf9a7c5\App_Web_panel.ascx.fdc5856b.a0mhhnzv.dll', Symbols loaded.
'iisexpress.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\0a486d18\8cf9a7c5\App_Web_articlelistingitempanel.ascx.2acfc5c3.nqj5yies.dll', Symbols loaded.
'iisexpress.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\0a486d18\8cf9a7c5\App_Web_otherheadlinespanel.ascx.205896d5.cg_7tycu.dll', Symbols loaded.
'iisexpress.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\0a486d18\8cf9a7c5\App_Web_articleheadlinesandotherheadlines.ascx.1d347881.zttdxgh7.dll', Symbols loaded.

Also, the output window writes each line quite slowly, at a rate of 2 - 3 lines per second (ie for each component). 此外,输出窗口以每秒2-3行(即每个组件)的速率非常缓慢地写入每一行。 The website uses loads of user controls to keep it more organised. 该网站使用大量用户控件来使其更有条理。

Is there anything that can be done to speed up the initial page load for development? 有什么办法可以加快开发的初始页面加载速度吗? It really wastes a lot of developer's time, having to wait all this time for the initial page load. 这真的浪费了很多开发人员的时间,不得不等待所有这些时间来进行初始页面加载。 I've been experimenting both with Cassini and IIS Express, but both seem to have similar loading times. 我一直在尝试使用Cassini和IIS Express,但两者似乎都有类似的加载时间。

Are you generating all your assemblies all times? 你是否一直在生成所有组件? I used to do it but now I set the build option (in solution properties) only in my working project. 我曾经这样做,但现在我只在我的工作项目中设置构建选项(在解决方案属性中)。 All of other dll will not be generated anymore unless I do manually. 除非我手动执行,否则不会再生成所有其他dll。

Because it is compiling your application for the first time since the last publish. 因为它是自上次发布以来第一次编译您的应用程序。 that is why it is slow for the first time. 这就是为什么它第一次变慢。 it re-compiles once after every publish. 它在每次发布后重新编译一次。 So, when ever you run/debug/compile it takes time recompile depending on the size of your application/libraries. 因此,无论何时运行/调试/编译,都需要时间重新编译,具体取决于应用程序/库的大小。

you could unload libraries and assemblies you are using in your website to make it load faster. 您可以卸载您在网站中使用的库和程序集,以加快其加载速度。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 ASP.NET Core:使用开发环境变量的非常慢(第一)页面加载时间 - ASP.NET Core: Very slow (first) page load time with development environment variable Asp.Net 页面需要很长时间才能加载 - Asp.Net Page takes a long time to load 如何在Visual Studio 2012上使用ASP.NET(包含MVC)C#配置或设置Log4Net - How to configure or setup Log4Net with ASP.NET ( included MVC) C# on Visual Studio 2012 ~ ~ c#,asp.net,压缩文件需要很长时间,浏览器变得无响应 - c#,asp.net, zipping file takes long time and browser become ir-responsive 如何使用Visual Studio 2012在ASP.net C#中生成水晶报表? - How to generate crystal report in ASP.net C# using visual studio 2012? 发送电子邮件联系表单C#Asp.net Visual Studio 2012 - sending email contact form c# asp.net visual studio 2012 网站在asp.net C#网站中启动时第一次且仅触发一次的事件 - Event which fires first and only one time when website starts in an asp.net c# website 在Visual Studio 2013上发布用c#asp.net创建的网站,我需要做什么? - What do I need to do to publish a website made in c# asp.net on Visual Studio 2013? c# Visual Studio Ultimate 2013 asp.net 网站发布部署 - c# visual studio ultimate 2013 asp.net website release deployment 长时间加载C#.NET中的第一个连接 - Long time to load first connection in C# .NET
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM