问题描述
错误提示:未能加载文件或程序集“Spring.Core,Version=1.3.0.20349,Culture=neutral,PublicKeyToken=65e474d141e25e07”或它的某一个依赖项。找到的程序集清单定义与程序集引用不匹配。(异常来自HRESULT:0x80131040)说明:执行当前Web请求期间,出现未经处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。异常详细信息:System.IO.FileLoadException:未能加载文件或程序集“Spring.Core,Version=1.3.0.20349,Culture=neutral,PublicKeyToken=65e474d141e25e07”或它的某一个依赖项。找到的程序集清单定义与程序集引用不匹配。(异常来自HRESULT:0x80131040)源错误:执行当前Web请求期间生成了未经处理的异常。可以使用下面的异常堆栈跟踪信息确定有关异常原因和发生位置的信息。程序集加载跟踪:下列信息有助于确定程序集“Spring.Core,Version=1.3.0.20349,Culture=neutral,PublicKeyToken=65e474d141e25e07”未能加载的原因。警告:程序集绑定日志记录被关闭。要启用程序集绑定失败日志记录,请将注册表值[HKLMSoftwareMicrosoftFusion!EnableLog](DWORD)设置为1。注意:会有一些与程序集绑定失败日志记录关联的性能损失。要关闭此功能,请移除注册表值[HKLMSoftwareMicrosoftFusion!EnableLog]。堆栈跟踪:[FileLoadException:未能加载文件或程序集“Spring.Core,Version=1.3.0.20349,Culture=neutral,PublicKeyToken=65e474d141e25e07”或它的某一个依赖项。找到的程序集清单定义与程序集引用不匹配。(异常来自HRESULT:0x80131040)]System.Reflection.RuntimeAssembly.GetType(RuntimeAssemblyassembly,Stringname,BooleanthrowOnError,BooleanignoreCase,ObjectHandleOnStacktype)+0System.Reflection.RuntimeAssembly.GetType(Stringname,BooleanthrowOnError,BooleanignoreCase)+67Spring.Core.TypeResolution.TypeResolver.LoadTypeDirectlyFromAssembly(TypeAssemblyHoldertypeInfo)inc:_prjspring-nettrunksrcSpringSpring.CoreCoreTypeResolutionTypeResolver.cs:115Spring.Core.TypeResolution.TypeResolver.Resolve(StringtypeName)inc:_prjspring-nettrunksrcSpringSpring.CoreCoreTypeResolutionTypeResolver.cs:59[TypeLoadException:Couldnotloadtypefromstringvalue'Spring.Data.NHibernate.LocalSessionFactoryObject,Spring.Data.NHibernate21'.]Spring.Core.TypeResolution.TypeResolver.Resolve(StringtypeName)inc:_prjspring-nettrunksrcSpringSpring.CoreCoreTypeResolutionTypeResolver.cs:77Spring.Core.TypeResolution.GenericTypeResolver.Resolve(StringtypeName)inc:_prjspring-nettrunksrcSpringSpring.CoreCoreTypeResolutionGenericTypeResolver.cs:97Spring.Core.TypeResolution.CachedTypeResolver.Resolve(StringtypeName)inc:_prjspring-nettrunksrcSpringSpring.CoreCoreTypeResolutionCachedTypeResolver.cs:107Spring.Core.TypeResolution.TypeResolutionUtils.ResolveType(StringtypeName)inc:_prjspring-nettrunksrcSpringSpring.CoreCoreTypeResolutionTypeResolutionUtils.cs:106Spring.Objects.Factory.Support.AbstractObjectDefinition.ResolveObjectType()inc:_prjspring-nettrunksrcSpringSpring.CoreObjectsFactorySupportAbstractObjectDefinition.cs:642Spring.Objects.Factory.Support.AbstractObjectFactory.ResolveObjectType(RootObjectDefinitionrod,StringobjectName)inc:_prjspring-nettrunksrcSpringSpring.CoreObjectsFactorySupportAbstractObjectFactory.cs:1092[CannotLoadObjectTypeException:Cannotresolvetype[Spring.Data.NHibernate.LocalSessionFactoryObject,Spring.Data.NHibernate21]forobjectwithname'SessionFactory'definedinassembly[cg.goal,Version=1.0.0.0,Culture=neutral,PublicKeyToken=null],resource[cg.goal.Spring_nhibernate.xml]line16]Spring.Objects.Factory.Support.AbstractObjectFactory.ResolveObjectType(RootObjectDefinitionrod,StringobjectName)inc:_prjspring-nettrunksrcSpringSpring.CoreObjectsFactorySupportAbstractObjectFactory.cs:1100Spring.Objects.Factory.Support.DefaultListableObjectFactory.PreInstantiateSingletons()inc:_prjspring-nettrunksrcSpringSpring.CoreObjectsFactorySupportDefaultListableObjectFactory.cs:472Spring.Context.Support.AbstractApplicationContext.Refresh()inc:_prjspring-nettrunksrcSpringSpring.CoreContextSupportAbstractApplicationContext.cs:1017Spring.Context.Support.WebApplicationContext..ctor(WebApplicationContextArgsargs)inc:_prjspring-nettrunksrcSpringSpring.WebContextSupportWebApplicationContext.cs:125_dynamic_Spring.Context.Support.WebApplicationContext..ctor(Object[])inc:_prjspring-nettrunksrcSpringSpring.WebCachingAspNetCache.cs:126Spring.Reflection.Dynamic.SafeConstructor.Invoke(Object[]arguments)inc:_prjspring-nettrunksrcSpringSpring.CoreReflectionDynamicDynamicConstructor.cs:116Spring.Context.Support.RootContextInstantiator.InvokeContextConstructor(ConstructorInfoctor)inc:_prjspring-nettrunksrcSpringSpring.CoreContextSupportContextHandler.cs:563Spring.Context.Support.ContextInstantiator.InstantiateContext()inc:_prjspring-nettrunksrcSpringSpring.CoreContextSupportContextHandler.cs:508Spring.Context.Support.ContextHandler.InstantiateContext(IApplicationContextparentContext,ObjectconfigContext,StringcontextName,TypecontextType,BooleancaseSensitive,String[]resources)inc:_prjspring-nettrunksrcSpringSpring.CoreContextSupportContextHandler.cs:344Spring.Context.Support.WebContextHandler.InstantiateContext(IApplicationContextparent,ObjectconfigContext,StringcontextName,TypecontextType,BooleancaseSensitive,String[]resources)inc:_prjspring-nettrunksrcSpringSpring.WebContextSupportWebContextHandler.cs:125Spring.Context.Support.ContextHandler.Create(Objectparent,ObjectconfigContext,XmlNodesection)inc:_prjspring-nettrunksrcSpringSpring.CoreContextSupportContextHandler.cs:289[ConfigurationErrorsException:Errorcreatingcontext'spring.root':未能加载文件或程序集“Spring.Core,Version=1.3.0.20349,Culture=neutral,PublicKeyToken=65e474d141e25e07”或它的某一个依赖项。找到的程序集清单定义与程序集引用不匹配。(异常来自HRESULT:0x80131040)]System.Configuration.BaseConfigurationRecord.EvaluateOne(String[]keys,SectionInputinput,BooleanisTrusted,FactoryRecordfactoryRecord,SectionRecordsectionRecord,ObjectparentResult)+199System.Configuration.BaseConfigurationRecord.Evaluate(FactoryRecordfactoryRecord,SectionRecordsectionRecord,ObjectparentResult,BooleangetLkg,BooleangetRuntimeObject,Object&result,Object&resultRuntimeObject)+1153System.Configuration.BaseConfigurationRecord.GetSectionRecursive(StringconfigKey,BooleangetLkg,BooleancheckPermission,BooleangetRuntimeObject,BooleanrequestIsHere,Object&result,Object&resultRuntimeObject)+1468System.Configuration.BaseConfigurationRecord.GetSection(StringconfigKey)+41System.Web.HttpContext.GetSection(StringsectionName)+76System.Web.Configuration.HttpConfigurationSystem.GetSection(StringsectionName)+77System.Web.Configuration.HttpConfigurationSystem.System.Configuration.Internal.IInternalConfigSystem.GetSection(StringconfigKey)+34System.Configuration.ConfigurationManager.GetSection(StringsectionName)+78Spring.Util.ConfigurationUtils.GetSection(StringsectionName)inc:_prjspring-nettrunksrcSpringSpring.CoreUtilConfigurationUtils.cs:69Spring.Context.Support.WebApplicationContext.GetContextInternal(StringvirtualPath)inc:_prjspring-nettrunksrcSpringSpring.WebContextSupportWebApplicationContext.cs:335Spring.Context.Support.WebApplicationContext.GetRootContext()inc:_prjspring-nettrunksrcSpringSpring.WebContextSupportWebApplicationContext.cs:223Spring.Context.Support.WebSupportModule.Init(HttpApplicationapp)inc:_prjspring-nettrunksrcSpringSpring.WebContextSupportWebSupportModule.cs:175System.Web.HttpApplication.InitModulesCommon()+135System.Web.HttpApplication.InitModules()+98System.Web.HttpApplication.InitInternal(HttpContextcontext,HttpApplicationStatestate,MethodInfo[]handlers)+759System.Web.HttpApplicationFactory.GetNormalApplicationInstance(HttpContextcontext)+356System.Web.HttpApplicationFactory.GetApplicationInstance(HttpContextcontext)+225System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequestwr)+398本人新手不大懂谢谢各位大侠的帮忙谢谢!!!!!
解决方案
解决方案二:
没引用把?
解决方案三:
缺少引用了[ConfigurationErrorsException:Errorcreatingcontext'spring.root':未能加载文件或程序集“Spring.Core,Version=1.3.0.20349,Culture=neutral,PublicKeyToken=65e474d141e25e07”或它的某一个依赖项。找到的程序集清单定义与程序集引用不匹配。(异常来自HRESULT:0x80131040)]提示很清楚了,重新添加这个引用完后右键这个引用有个熟悉大概叫CopyToLocal置为true
解决方案四:
找到对应的DLL文件放在你的bin目录下,然后重新再引用一次,确保bin下有这个DLL就可以了。另外再看看是否需要将DLL注册到windows/system32下。不需要就不用了