我們使用的Web應用程序的一部分使用內部Web控件程序集。此程序集包含多個Web用戶控件,其中幾個由其他Web控件在同一個程序集中使用。ASP.NET將所有程序集加載到bin中以查找用戶控件
程序集是作爲一個Web部署項目的網站而構建的。
主Web應用程序的頁面通過服務動態編譯爲單個程序集並放入相應的bin文件夾中。在我們的開發服務器中,舊的程序集並不總是被整理和刪除,這意味着文件夾會充滿舊的程序集。
當使用內部網頁控制程序集(上面提到的)的頁面運行時,asp.net實例會加載所有舊程序集,以試圖確定哪個程序集包含引用用戶控件正在被同一個程序集內的其他用戶控件使用。
我們已經使用了頂級用戶裏面以下控制應用程序運行此沒有給出關於哪個組件它可以找到它的時候註冊的其他控件
<%@ Register Src="~/....ascx" TagPrefix="UC" TagName="...." %>
當然。
以前有沒有人遇到過這個問題? 這不是一個真正的問題,因爲我們的在線服務器使用清理工具來刪除舊的程序集,但是仍然有可能導致內存不足的潛在情況(例如工具停止工作!),所以它會是很高興解決這個問題。
感謝
這裏是堆棧跟蹤
[OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.]
System.Reflection.Assembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection) +0
System.Reflection.Assembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection) +43
System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +127
System.Reflection.Assembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +142
System.Reflection.Assembly.Load(String assemblyString) +28
System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +46
[ConfigurationErrorsException: Exception of type 'System.OutOfMemoryException' was thrown.]
System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +613
System.Web.Configuration.CompilationSection.LoadAllAssembliesFromAppDomainBinDirectory() +203
System.Web.Configuration.CompilationSection.LoadAssembly(AssemblyInfo ai) +105
System.Web.Compilation.BuildManager.GetReferencedAssemblies(CompilationSection compConfig) +178
System.Web.Compilation.BuildProvidersCompiler..ctor(VirtualPath configPath, Boolean supportLocalization, String outputAssemblyName) +54
System.Web.Compilation.CodeDirectoryCompiler.GetCodeDirectoryAssembly(VirtualPath virtualDir, CodeDirectoryType dirType, String assemblyName, StringSet excludedSubdirectories, Boolean isDirectoryAllowed) +8812786
System.Web.Compilation.BuildManager.CompileCodeDirectory(VirtualPath virtualDir, CodeDirectoryType dirType, String assemblyName, StringSet excludedSubdirectories) +128
System.Web.Compilation.BuildManager.CompileCodeDirectories() +265
System.Web.Compilation.BuildManager.EnsureTopLevelFilesCompiled() +320
[HttpException (0x80004005): Exception of type 'System.OutOfMemoryException' was thrown.]
System.Web.Compilation.BuildManager.ReportTopLevelCompilationException() +58
System.Web.Compilation.BuildManager.EnsureTopLevelFilesCompiled() +512
System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters) +729
[HttpException (0x80004005): Exception of type 'System.OutOfMemoryException' was thrown.]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +8894095
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +85
System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr) +259
我不知道肯定,但可以想象,強烈命名您的組件可能會解決問題 - 至少它會限制什麼組件ASP.Net會考慮裝載 – Basic 2010-10-25 13:17:02
我知道這是一個老問題,但我猜如果你打算在** AssemblyInfo.cs **中使用增量構建**,問題可能會消失,如: '[assembly:AssemblyVersion(「1.0。*」)] [assembly:AssemblyFileVersion(「1.0 。*「)]' – Amro 2016-04-20 07:09:18