从项目中删除Elmah后获得与Elmah相关的异常

时间:2015-05-07 13:38:14

标签: c# .net asp.net-mvc elmah

我想在删除Elmah时忘记了一些愚蠢的事情,因为我在运行时遇到了绑定异常......

  

System.IO.FileNotFoundException:无法加载文件或程序集   'Elmah'或其中一个依赖项。系统找不到该文件   指定。

全球解决方案搜索Elmah这个词(不区分大小写)没有透露任何内容。我已经清理了解决方案,清空了bin文件夹,检查了IIS Express设置。关于Elmah的一句话......我不知道还有什么要去看。

装配加载跟踪

=== Pre-bind state information ===
LOG: DisplayName = Elmah
 (Partial)
WRN: Partial binding information was supplied for an assembly:
WRN: Assembly Name: Elmah | Domain ID: 2
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:///W:/ImplementationSuiviProjet/Source/Portail/
LOG: Initial PrivatePath = W:\ImplementationSuiviProjet\Source\Portail\bin
Calling assembly : (Unknown).
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: W:\ImplementationSuiviProjet\Source\Portail\web.config
LOG: Using host configuration file: C:\Users\Pier-Luc Michaud\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:/Windows/Microsoft.NET/Framework/v4.0.30319/Temporary ASP.NET Files/portail/9481be8a/4a40a731/Elmah.DLL.
LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/Temporary ASP.NET Files/portail/9481be8a/4a40a731/Elmah/Elmah.DLL.
LOG: Attempting download of new URL file:///W:/ImplementationSuiviProjet/Source/Portail/bin/Elmah.DLL.
LOG: Attempting download of new URL file:///W:/ImplementationSuiviProjet/Source/Portail/bin/Elmah/Elmah.DLL.
LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/Temporary ASP.NET Files/portail/9481be8a/4a40a731/Elmah.EXE.
LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/Temporary ASP.NET Files/portail/9481be8a/4a40a731/Elmah/Elmah.EXE.
LOG: Attempting download of new URL file:///W:/ImplementationSuiviProjet/Source/Portail/bin/Elmah.EXE.
LOG: Attempting download of new URL file:///W:/ImplementationSuiviProjet/Source/Portail/bin/Elmah/Elmah.EXE.

堆栈跟踪

[FileNotFoundException: Could not load file or assembly 'Elmah' or one of its dependencies. The system cannot find the file specified.]
   System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMarkHandle stackMark, IntPtr pPrivHostBinder, Boolean loadTypeFromPartialName, ObjectHandleOnStack type) +0
   System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean loadTypeFromPartialName) +70
   System.RuntimeType.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark) +40
   System.Type.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase) +37
   System.Web.Compilation.BuildManager.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase) +65
   System.Web.Configuration.ConfigUtil.GetType(String typeName, String propertyName, ConfigurationElement configElement, XmlNode node, Boolean checkAptcaBit, Boolean ignoreCase) +38

[ConfigurationErrorsException: Could not load file or assembly 'Elmah' or one of its dependencies. The system cannot find the file specified.]
   System.Web.Configuration.ConfigUtil.GetType(String typeName, String propertyName, ConfigurationElement configElement, XmlNode node, Boolean checkAptcaBit, Boolean ignoreCase) +353
   System.Web.Configuration.ConfigUtil.GetType(String typeName, String propertyName, ConfigurationElement configElement, Boolean checkAptcaBit) +21
   System.Web.Configuration.Common.ModulesEntry.SecureGetType(String typeName, String propertyName, ConfigurationElement configElement) +39
   System.Web.Configuration.Common.ModulesEntry..ctor(String name, String typeName, String propertyName, ConfigurationElement configElement) +42
   System.Web.HttpApplication.BuildIntegratedModuleCollection(List`1 moduleList) +160
   System.Web.HttpApplication.GetModuleCollection(IntPtr appContext) +1068
   System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +82
   System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +172
   System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +336
   System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +296

[HttpException (0x80004005): Could not load file or assembly 'Elmah' or one of its dependencies. The system cannot find the file specified.]
   System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +10037820
   System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +101
   System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +254

Web.config

.csproj

1 个答案:

答案 0 :(得分:0)

似乎IIS配置已损坏。我删除了网站,现在工作正常。我真的很困惑文件如何被破坏了。我昨天离开办公室时很好。

它与在同一个项目的不同分支之间工作有关,但我无法确切地说出是什么导致了它。