ASP.NET – IIS7 – IBM DB2问题
发布时间:2020-12-15 20:13:46 所属栏目:asp.Net 来源:网络整理
导读:我在一个调用DB2数据库的ASP.NET网站上工作.我将Visual Studio安装在 Windows 2008服务器上,该站点将被托管.当我在Visual Studio中调试站点时,使用集成的Web服务器,我可以连接到数据库,站点运行正常.当我将IIS7中的站点设置在同一个服务器上时,由于出现以下
我在一个调用DB2数据库的ASP.NET网站上工作.我将Visual Studio安装在
Windows 2008服务器上,该站点将被托管.当我在Visual Studio中调试站点时,使用集成的Web服务器,我可以连接到数据库,站点运行正常.当我将IIS7中的站点设置在同一个服务器上时,由于出现以下错误,我无法访问站点或数据库.
以下是技术细节: Windows 2008 Server IIS 7 Visual Studio 2010 Premium DB2 v9.5.301.436 Could not load file or assembly 'IBM.Data.DB2' or one of its dependencies. An attempt was made to load a program with an incorrect format. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.BadImageFormatException: Could not load file or assembly 'IBM.Data.DB2' or one of its dependencies. An attempt was made to load a program with an incorrect format. Source Error: An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. Assembly Load Trace: The following information can be helpful to determine why the assembly 'IBM.Data.DB2' could not be loaded. WRN: Assembly binding logging is turned OFF. To enable assembly bind failure logging,set the registry value [HKLMSoftwareMicrosoftFusion!EnableLog] (DWORD) to 1. Note: There is some performance penalty associated with assembly bind failure logging. To turn this feature off,remove the registry value [HKLMSoftwareMicrosoftFusion!EnableLog]. Stack Trace: [BadImageFormatException: Could not load file or assembly 'IBM.Data.DB2' or one of its dependencies. An attempt was made to load a program with an incorrect format.] System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName,String codeBase,Evidence assemblySecurity,RuntimeAssembly locationHint,StackCrawlMark& stackMark,Boolean throwOnFileNotFound,Boolean forIntrospection,Boolean suppressSecurityChecks) +0 System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef,Boolean suppressSecurityChecks) +567 System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString,Boolean forIntrospection) +192 System.Reflection.Assembly.Load(String assemblyString) +35 System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName,Boolean starDirective) +118 [ConfigurationErrorsException: Could not load file or assembly 'IBM.Data.DB2' or one of its dependencies. An attempt was made to load a program with an incorrect format.] System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName,Boolean starDirective) +11424435 System.Web.Configuration.CompilationSection.LoadAllAssembliesFromAppDomainBinDirectory() +484 System.Web.Configuration.AssemblyInfo.get_AssemblyInternal() +127 System.Web.Compilation.BuildManager.GetReferencedAssemblies(CompilationSection compConfig) +334 System.Web.Compilation.BuildManager.CallPreStartInitMethods() +280 System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager,IApplicationHost appHost,IConfigMapPathFactory configMapPathFactory,HostingEnvironmentParameters hostingParameters,PolicyLevel policyLevel,Exception appDomainCreationException) +1167 [HttpException (0x80004005): Could not load file or assembly 'IBM.Data.DB2' or one of its dependencies. An attempt was made to load a program with an incorrect format.] System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +11556592 System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +141 System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr,HttpContext context) +4813333 我不明白网站如何使用Visual Studio Web服务器运行良好,而不能在IIS中运行.我不知道这是否是IIS问题,或者是我正在使用的IMB.Data.DB2.dll的版本.如果有任何人有解决方案或任何想法,他们将不胜感激. 谢谢. 解决方法
要做这个工作,我不得不进入IIS管理器,点击应用程序池节点,点击应用程序池的网站,然后点击屏幕右侧的高级设置.然后我将启用32位应用程序更改为true.
这解决了我的问题,网站运行正常. (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
相关内容
- asp.net-mvc – ASP.NET MVC显示格式不会将DateTime格式化为
- asp.net-mvc-3 – 用于ASP.NET MVC的Razor View Engine的源
- asp.net-mvc – MVC控制器与开箱即用的Sitecore控制器
- asp.net-mvc – Orchard CMS:退出(注销)确认页面
- asp.net – 未在生产服务器中的WCF调用上传递凭据
- asp.net-mvc-2 – 在MVC中实现自定义标识和IPrincipal
- asp.net-mvc – 如何在Require.js中引用捆绑的js文件(asp.n
- asp.net – 选择下拉列表项目findbytext没有区分大小写vb.n
- asp.net-mvc-3 – Razor View引擎中的全局变量
- asp.net-core – MVC 6安装为Windows服务(ASP.NET Core 1.0
推荐文章
站长推荐
- asp.net-mvc – 文件输入MVC 3所需的客户端验证
- asp-classic – 如何在经典ASP中将数据POST到远程
- entity-framework – 使用F#和ASP.NET MVC保存EF
- asp.net-mvc – 当前建议在Azure网站中为会话变量
- asp.net – .NET 4.5中的样式包和CSS中的图标
- asp.net – 在代码中设置PageSize时,DataPager停
- asp.net-mvc – 如何在LINQ中查询列表
- asp.net-mvc – 使用JSON结果填充下拉列表 – 使
- 我应该学习不了解MVC 1或2的asp.NET MVC 3吗?
- asp.net – 单独配置文件为web.config的部分
热点阅读