问题描述
未能加载文件或程序集“ActiproSoftware.CodeHighlighter.Net20(2)”或它的某一个依赖项。找到的程序集清单定义与程序集引用不匹配。(异常来自HRESULT:0x80131040)说明:执行当前Web请求期间,出现未经处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。异常详细信息:System.IO.FileLoadException:未能加载文件或程序集“ActiproSoftware.CodeHighlighter.Net20(2)”或它的某一个依赖项。找到的程序集清单定义与程序集引用不匹配。(异常来自HRESULT:0x80131040)源错误:执行当前Web请求期间生成了未经处理的异常。可以使用下面的异常堆栈跟踪信息确定有关异常原因和发生位置的信息。程序集加载跟踪:下列信息有助于确定程序集“ActiproSoftware.CodeHighlighter.Net20(2)”未能加载的原因。===预绑定状态信息===日志:DisplayName=ActiproSoftware.CodeHighlighter.Net20(2)(Partial)警告:为程序集提供了部分绑定信息:警告:程序集名称:ActiproSoftware.CodeHighlighter.Net20(2)|域ID:4警告:当仅提供程序集显示名称的一部分时,将发生部分绑定。警告:这可能导致联编程序加载错误的程序集。警告:建议为程序集提供完全指定的文字标识,警告:并由简单名称、版本、区域性和公钥标记组成。警告:有关此问题的详细信息和常见解决方案,请参见白皮书http://go.microsoft.com/fwlink/?LinkId=109270。日志:Appbase=file:///C:/Users/Administrator/Desktop/shangcheng/日志:初始PrivatePath=C:UsersAdministratorDesktopshangchengbin调用程序集:(Unknown)。===日志:此绑定从default加载上下文开始。日志:正在使用应用程序配置文件:C:UsersAdministratorDesktopshangchengweb.config日志:使用主机配置文件:日志:使用C:WindowsMicrosoft.NETFrameworkv4.0.30319configmachine.config的计算机配置文件。日志:此时没有为引用应用策略(私有、自定义、分部或基于位置的程序集绑定)。日志:尝试下载新的URLfile:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/TemporaryASP.NETFiles/shangcheng/53bba1df/1963763a/ActiproSoftware.CodeHighlighter.Net20(2).DLL。日志:尝试下载新的URLfile:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/TemporaryASP.NETFiles/shangcheng/53bba1df/1963763a/ActiproSoftware.CodeHighlighter.Net20(2)/ActiproSoftware.CodeHighlighter.Net20(2).DLL。日志:尝试下载新的URLfile:///C:/Users/Administrator/Desktop/shangcheng/bin/ActiproSoftware.CodeHighlighter.Net20(2).DLL。警告:比较程序集名称时发生不匹配:NAME错误:未能完成程序集的安装(hr=0x80131040)。探测终止。堆栈跟踪:[FileLoadException:未能加载文件或程序集“ActiproSoftware.CodeHighlighter.Net20(2)”或它的某一个依赖项。找到的程序集清单定义与程序集引用不匹配。(异常来自HRESULT:0x80131040)]System.Reflection.RuntimeAssembly._nLoad(AssemblyNamefileName,StringcodeBase,EvidenceassemblySecurity,RuntimeAssemblylocationHint,StackCrawlMark&stackMark,IntPtrpPrivHostBinder,BooleanthrowOnFileNotFound,BooleanforIntrospection,BooleansuppressSecurityChecks)+0System.Reflection.RuntimeAssembly.nLoad(AssemblyNamefileName,StringcodeBase,EvidenceassemblySecurity,RuntimeAssemblylocationHint,StackCrawlMark&stackMark,IntPtrpPrivHostBinder,BooleanthrowOnFileNotFound,BooleanforIntrospection,BooleansuppressSecurityChecks)+34System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyNameassemblyRef,EvidenceassemblySecurity,RuntimeAssemblyreqAssembly,StackCrawlMark&stackMark,IntPtrpPrivHostBinder,BooleanthrowOnFileNotFound,BooleanforIntrospection,BooleansuppressSecurityChecks)+152System.Reflection.RuntimeAssembly.InternalLoad(StringassemblyString,EvidenceassemblySecurity,StackCrawlMark&stackMark,IntPtrpPrivHostBinder,BooleanforIntrospection)+77System.Reflection.RuntimeAssembly.InternalLoad(StringassemblyString,EvidenceassemblySecurity,StackCrawlMark&stackMark,BooleanforIntrospection)+16System.Reflection.Assembly.Load(StringassemblyString)+28System.Web.Configuration.CompilationSection.LoadAssemblyHelper(StringassemblyName,BooleanstarDirective)+38[ConfigurationErrorsException:未能加载文件或程序集“ActiproSoftware.CodeHighlighter.Net20(2)”或它的某一个依赖项。找到的程序集清单定义与程序集引用不匹配。(异常来自HRESULT:0x80131040)]System.Web.Configuration.CompilationSection.LoadAssemblyHelper(StringassemblyName,BooleanstarDirective)+752System.Web.Configuration.CompilationSection.LoadAllAssembliesFromAppDomainBinDirectory()+218System.Web.Configuration.CompilationSection.LoadAssembly(AssemblyInfoai)+130System.Web.Compilation.BuildManager.GetReferencedAssemblies(CompilationSectioncompConfig)+170System.Web.Compilation.BuildManager.GetPreStartInitMethodsFromReferencedAssemblies()+91System.Web.Compilation.BuildManager.CallPreStartInitMethods(StringpreStartInitListPath,Boolean&isRefAssemblyLoaded)+285System.Web.Compilation.BuildManager.ExecutePreAppStart()+153System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManagerappManager,IApplicationHostappHost,IConfigMapPathFactoryconfigMapPathFactory,HostingEnvironmentParametershostingParameters,PolicyLevelpolicyLevel,ExceptionappDomainCreationException)+521[HttpException(0x80004005):未能加载文件或程序集“ActiproSoftware.CodeHighlighter.Net20(2)”或它的某一个依赖项。找到的程序集清单定义与程序集引用不匹配。(异常来自HRESULT:0x80131040)]System.Web.HttpRuntime.FirstRequestInit(HttpContextcontext)+9951956System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContextcontext)+101System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequestwr)+456
解决方案
解决方案二:
未能加载都是先看引用里面有没有,没有的话看bin下面有没有,都没有的话就找这个dll然后添加引用……
解决方案三:
右键程序集属性名称,命名空间检查(不但要检测程序集里面的命名空间,还要检测dal中命名空间是否争取)。没问题的话当前程序集要添加dal.dll