System.BadImageFormatException - 将DLL更新到最新版本时无效令牌?

时间:2011-03-17 03:48:41

标签: c# asp.net

我使用几个公司特定的DLL运行了这个项目几个月。我刚下载并更新到最新版本,我现在收到此错误。我不相信它是特定于DLL本身,更多的东西在我的项目不期望新版本。堆栈跟踪不是很有帮助。

  

'/ dashbad'应用程序中的服务器错误。

     

令牌无效。

     

描述:执行期间发生了未处理的异常   当前的网络请求。请查看堆栈跟踪了解更多信息   有关错误的信息以及它在代码中的起源。

     

异常详细信息:System.BadImageFormatException:令牌无效。

     

来源错误:

     

执行期间生成了未处理的异常   当前的网络请求。有关的来源和位置的信息   可以使用下面的异常堆栈跟踪来识别异常。

     

堆栈追踪:

     

[BadImageFormatException:令牌无效。]
  System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName,String   codeBase,Evidence assemblySecurity,RuntimeAssembly locationHint,   StackCrawlMark&安培; stackMark,Boolean throwOnFileNotFound,Boolean   forIntrospection,Boolean suppressSecurityChecks)+0
  System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName,String   codeBase,Evidence assemblySecurity,RuntimeAssembly locationHint,   StackCrawlMark&安培; stackMark,Boolean throwOnFileNotFound,Boolean   forIntrospection,Boolean suppressSecurityChecks)+39
  System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(的AssemblyName   assemblyRef,Evidence assemblySecurity,StackCrawlMark& stackMark,   Boolean forIntrospection,Boolean suppressSecurityChecks)+132
  System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString,   证据集合安全,StackCrawlMark& stackMark,布尔   forIntrospection)+144 System.Reflection.Assembly.Load(String   assemblyString)+28
  System.Web.Configuration.CompilationSection.LoadAssemblyHelper(字符串   assemblyName,布尔starDirective)+46

     

[ConfigurationErrorsException:令牌无效。]
  System.Web.Configuration.CompilationSection.LoadAssemblyHelper(字符串   assemblyName,布尔starDirective)+618
  System.Web.Configuration.CompilationSection.LoadAllAssembliesFromAppDomainBinDirectory()   +209 System.Web.Configuration.CompilationSection.LoadAssembly(AssemblyInfo   ai)+130
  System.Web.Compilation.BuildManager.GetReferencedAssemblies(CompilationSection   compConfig)+178
  System.Web.Compilation.BuildManager.GetPreStartInitMethodsFromReferencedAssemblies()   +94 System.Web.Compilation.BuildManager.CallPreStartInitMethods()+332 System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager   appManager,IApplicationHost appHost,IConfigMapPathFactory   configMapPathFactory,HostingEnvironmentParameters hostingParameters,   PolicyLevel policyLevel,Exception appDomainCreationException)+591

     

[HttpException(0x80004005):令牌无效。]
  System.Web.HttpRuntime.FirstRequestInit(HttpContext context)+8950644   System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context)+97   System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest   wr,HttpContext context)+256

     

版本信息:Microsoft .NET Framework版本:4.0.30319;   ASP.NET版本:4.0.30319.1

是否有人在类似设置/任何调试建议中遇到此错误?

1 个答案:

答案 0 :(得分:2)

这可能是32位/ 64位问题。您可以尝试使用编译来定位特定平台,看看这是否可以解决您的问题。