部署问题:Oracle + EF4 +赢服务器2008

发布于 2024-12-18 21:32:35 字数 1393 浏览 4 评论 0原文

我有一个 ASP.NET Web 窗体应用程序,正在 Win7 本地计算机上针对 .NET 4.0 构建并运行该应用程序。 (本地机器上一切正常。)我的应用程序针对 Oracle DB 运行 EF4.1,因此我使用 Oracle EF 数据提供程序,该提供程序仍处于测试阶段。

现在,我可以使用本地 VS2010 中的 Web 部署成功地将应用程序部署到我的 Win2008 Server 目标计算机,但是当我在目标上运行应用程序时,我得到经典的 Unable to find the requested .Net Framework Data Provider错误。

这是我的(不成功) 设置,截至目前:

  • 32 位应用程序在应用程序池 (.NET 4.0) 中启用 Win2008 Server 目标。

  • 在我的本地 VS2010 解决方案中,对于 Oracle.DataAccess DLL,

    Copy Local 设置为 true

  • 两者平台平台目标设置均设为任何 CPU > 在我的本地构建配置中。 (我已经尝试过 此处的不同设置均未成功。)

  • Win2008 Server 目标没有Oracle.DataAccess DLL GAC。 (我认为在 Oracle DLL 上设置 Copy Local 会 意味着我不需要 GAC。)

编辑:我已尝试对 Oracle.DataAccess DLL 进行 GAC,但出现了与 此处。 (我仍然需要对此进行调查。)此外,我的目标机器上已经有另一个 Oracle 客户端,安装 Oracle EF 数据提供程序附带的 Oracle 客户端似乎会干扰它。不能允许这种情况发生。

问题 1:我需要选择构建配置设置(在本地机器上)和 IIS 设置(在目标上)的什么组合才能在 2008 Server 上运行我的应用程序?

问题 2:如何在不在目标服务器上安装另一个 Oracle 客户端的情况下使其正常工作?

再次感谢您的帮助。

更新:一切正常。请参阅下面我的回答,获取完整解决方案的链接以及有用信息的链接。

I have an ASP.NET Web Forms app that I am building and running against .NET 4.0 on a Win7 local machine. (All is OK on local box.) My app is running EF4.1 against an Oracle DB, so I am using the Oracle EF data provider, which is still in Beta.

Right now, I can successfully deploy the app to my Win2008 Server target machine using Web Deploy from my local VS2010, but when I run the app on the target, I get the classic Unable to find the requested .Net Framework Data Provider error.

Here's my (unsuccessful) setup, as of now:

  • 32-bit applications are enabled in the app pool (.NET 4.0) on the
    Win2008 Server target.

  • Copy Local is set to true for the Oracle.DataAccess DLL in my local VS2010 solution.

  • Both of the Platform and Platform target settings are set to Any CPU in my local Build Configuration. (I have tried
    different settings here without success.)

  • The Win2008 Server target does not have an Oracle.DataAccess DLL in
    the GAC. (I thought that setting Copy Local on the Oracle DLL would
    mean that I didn't need the GAC.)

EDIT: I have tried to GAC the Oracle.DataAccess DLL, but I get the same error that is discussed here. (I still have to investigate this.) Also, there is already another Oracle client on my target box, and installing the Oracle client that comes with the Oracle EF data provider seems to interfere with it. This cannot be allowed to happen.

Question 1: What combination of build configuration settings (on the local box) and IIS settings (on the target) do I need to select in order to be able to run my app on the 2008 Server?

Question 2: How can I get this to work without installing another Oracle client on my target server?

Thanks again for the help.

Update: All is working. See my answer below for a link to the full solution, as well as links to helpful information.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

小巷里的女流氓 2024-12-25 21:32:35

由于您的服务器在 GAC 中没有 Oracle.DataAccess,这表明您尚未在该计算机上安装 Oracle 客户端,并且正在尝试通过将 Oracle.DataAccess.dll 部署为应用程序的一部分来使其工作。

我不太确定服务器上需要安装什么。我通常只是在服务器上运行 Oracle 安装程序,以确保安装所有必需的 Oracle 文件和设置。如果这样做,则无需将 Oracle.DataAccess.dll 与应用程序一起部署,它已经位于服务器的 GAC 中。

我确实知道需要的一件事是一个配置设置,它告诉系统如何创建提供程序的新实例。您可以尝试将该设置添加到 web.config 中,并尝试是否足够,但同样,可能需要大量依赖 DLL 和设置才能让 Oracle 提供程序正常工作。

设置是(这是ODP.Net的另一个版本,你可以在你自己的机器上的machine.config中找到正确的设置):

<system.data>
  <DbProviderFactories>
     <add name="Oracle Data Provider for .NET" invariant="Oracle.DataAccess.Client"
          description="Oracle Data Provider for .NET" type="Oracle.DataAccess.Client.OracleClientFactory, Oracle.DataAccess, Version=4.112.1.2, Culture=neutral, PublicKeyToken=89b483f429c47342" />
</DbProviderFactories>
</system.data>

Since your server doesn't have Oracle.DataAccess in the GAC, that indicates that you haven't installed the Oracle client on that machine and are trying to make it work by deploying Oracle.DataAccess.dll as part of your app.

I'm not quite sure exactly what needs to be installed on the server. I usually just run the Oracle setup on the server to ensure that all the necessary Oracle files and settings get installed. If you do that, you don't need to deploy Oracle.DataAccess.dll along with your app, it will already be in the server's GAC.

One thing I do know is needed is a config setting that tells the system how to create a new instance of the provider. You can try to add that setting to your web.config and try if that is enough, but again, there may be a lot of dependent DLLs and settings you need for the Oracle provider to work.

The setting is (this is for another version of ODP.Net, you will find the correct settings in machine.config on your own machine):

<system.data>
  <DbProviderFactories>
     <add name="Oracle Data Provider for .NET" invariant="Oracle.DataAccess.Client"
          description="Oracle Data Provider for .NET" type="Oracle.DataAccess.Client.OracleClientFactory, Oracle.DataAccess, Version=4.112.1.2, Culture=neutral, PublicKeyToken=89b483f429c47342" />
</DbProviderFactories>
</system.data>
风追烟花雨 2024-12-25 21:32:35

GTG的解决方案至少提供了我的问题1的部分答案,所以我赞成他的解决方案。对于对我的问题 2(如何执行不显眼的 ODAC 安装)感兴趣的其他人,可以找到答案 此处。 (寻找 AnthonyVO 的答案,因为它封装了所有必要的信息。)

我应该提到的是,我还没有能够找到适合我的不引人注目的解决方案,但很多人都有,而且这是我需要实施的解决方案。

更新:案件已结。我缺少 Oracle DLL。我的完整设置显示在此处

GTG's solution provides at least part of the answer to my Question 1, so I am upvoting his solution. For anyone else interested in my Question 2 (how to perform an unobtrusive ODAC installation), an answer can be found here. (Look for AnthonyVO's answer, as it encapsulates all the necessary information.)

I should mention that I have not yet been able to get the unobtrusive solution to work for me, but many have, and it is the solution that I need to implement.

UPDATE: Case closed. I was missing an Oracle DLL. My full setup is shown here.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文