【发布时间】:2011-03-13 16:06:18
【问题描述】:
我有一台 Windows Server 2008 x64 机器,并已使用 ODAC 11g 客户端成功地将简单的 ASP.NET/C# 应用程序连接到 Oracle 数据库。我的下一步是将这个相同的 oracle 连接添加到 SharePoint Web 部件(在同一台计算机上开发)。 SharePoint Server、Web Server 等也都位于同一台机器上。我想我可以将 Oracle.DataAccess 引用添加到我的 SharePoint Web 部件,添加 oracle 连接代码,然后就完成了......但是现在......我在通过浏览器加载我的 Web 部件时收到以下错误预言机连接:
[BadImageFormatException:无法加载文件或程序集“Oracle.DataAccess,版本=2.112.1.1,Culture=neutral,PublicKeyToken=89b483f429c47342”或其依赖项之一。试图加载格式不正确的程序。]
有人可以帮我调试一下吗?我在 GAC 中有正确版本的程序集。由于某种原因它没有看到它?我对为什么一个简单的 ASP.NET/C# 应用程序可以正常工作感到困惑,但现在它在 SharePoint 上它不起作用。有什么想法吗?
具体错误:
[TargetInvocationException:调用的目标已抛出异常。] 在 System.RuntimeTypeHandle.CreateInstance(RuntimeType 类型,Boolean publicOnly,Boolean noCheck,Boolean& canBeCached,RuntimeMethodHandle& ctor,Boolean& bNeedSecurityCheck) 在 System.RuntimeType.CreateInstanceSlow(布尔 publicOnly,布尔填充缓存) 在 System.RuntimeType.CreateInstanceImpl(布尔 publicOnly,布尔 skipVisibilityChecks,布尔填充缓存) 在 System.Activator.CreateInstance(类型类型,布尔非公共) 在 Microsoft.SharePoint.WebPartPages.SPWebPartReflectionHelper.GetDefaultControl(类型 controlType) 在 Microsoft.SharePoint.WebPartPages.BinaryWebPartDeserializer.LoadInitialWebPart() 在 Microsoft.SharePoint.WebPartPages.BinaryWebPartDeserializer.Deserialize() 在 Microsoft.SharePoint.WebPartPages.SPWebPartManager.CreateWebPartsFromRowSetData(Boolean onlyInitializeClosedWebParts)
[BadImageFormatException:无法加载文件或程序集“Oracle.DataAccess,版本=2.112.1.1,Culture=neutral,PublicKeyToken=89b483f429c47342”或其依赖项之一。试图加载格式不正确的程序。] 在 PortalOBIEEReportList.OBIEEReportList.OBIEEReportList..ctor()
【问题讨论】:
-
你在同一台机器上安装了oracle 10g吗?
-
不,Oracle 11g 安装在同一台机器上...我也在运行 ODAC 11g 客户端。我很困惑,因为我的非 SharePoint ASP.Net/C# 应用程序连接得很好。看起来好像是 32 位与 64 位的问题,但一切都是 11g/64 位。
-
我什至尝试在VS项目中将平台设置为x64,但没有成功。
标签: c# asp.net sharepoint