底层提供程序在Open上失败 - 使用ADO.net实体数据模型 [英] The underlying provider failed on Open - Using ADO.net Entity Data Model

查看:97
本文介绍了底层提供程序在Open上失败 - 使用ADO.net实体数据模型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

系统设置
开发工具:  Visual Studio 2008 SP1与.Net 3.5框架和MVC 1.0 
操作系统:Windows 2003服务器标准
数据库: Oracle 10g2

问题:
我创建了一个MVC风格的网站,在其中,我创建了一个实体数据模型(基于Oracle数据库中的现有表格)并进行了设置移植到web.config文件中。 我构建了解决方案并生成了SSDL,CSDL和MSL文件,当我在调试模式下运行网站时,我可以毫无问题地连接到数据库。

我将应用程序部署到本地版本IIS,我甚至无法启动应用程序而不会收到可怕的浏览器错误消息:

"这是一个标记由预编译工具生成的文件,不应删除!"

System Setup
Development tools:  Visual Studio 2008 SP1 with .Net 3.5 framework and MVC 1.0 
O/S: Windows 2003 server standard
Database: Oracle 10g2

Issue:
I created a MVC style website and within it, I created an Entity Data Model (based off exisiting tables in the Oracle Database) and had the settings ported into the web.config file.  I built the solution and had the SSDL, CSDL and MSL files generated and when I run website in debug mode, I can connect to the DB without issues.

Whe I deploy the application out to a local version of IIS, I can't even start up the app without getting the dreaded browser error message:

"This is a marker file generated by the precompilation tool, and should not be deleted!"

 

我的网站内置了一个记录工具,所以在挖掘错误信息之后,我注意到我有以下内容:

10-03- 18-03:11:14   基础提供商在开放时失败。
10-03-18-03:11:14   数据库连接失败的原因是:抛出了类型"MyApp.DatabaseConnectionException"的异常.----抛出了类型"MyApp.DatabaseConnectionException"的异常。

这是来自的连接字符串在我的web.config中:

< add name =" WebConnection" connectionString =" metadata =〜/ bin / Metadata.csdl |〜/ bin / Metadata.ssdl |〜/ bin / Metadata.msl; provider = System.Data.Oracle; provider connection string =& quot; Data Source = WebApp ;用户ID = xxxx;密码= xxxx& quot;"的providerName = QUOT; System.Data.EntityClient" />

我可以从Visual Studio中连接到数据库并执行成功的选择查询。 连接字符串是由实体模型向导复制的。

那么为什么我在调试模式下而不是在部署之后才能工作? 想法?
谢谢,
HH

I have a logger tool built into my website so after digging up the error message, I noticed that I had the following in there:

10-03-18-03:11:14    The underlying provider failed on Open.
10-03-18-03:11:14    Database connection failed because of: Exception of type 'MyApp.DatabaseConnectionException' was thrown.----Exception of type 'MyApp.DatabaseConnectionException' was thrown.

Here is the connection string from within my web.config:

<add name="WebConnection" connectionString="metadata=~/bin/Metadata.csdl|~/bin/Metadata.ssdl|~/bin/Metadata.msl;provider=System.Data.Oracle;provider connection string=&quot;Data Source=WebApp;User ID=xxxx;Password=xxxx&quot;" providerName="System.Data.EntityClient" />

I can connect to the database from within Visual Studio and perform succesful select queries as well.  The connection string was copied by the entity model wizard.

So why would it work when I'm in debug mode and not after I deployed it?  Thoughts?
Thanks,
HH

推荐答案

我希望这些信息可以帮到你:

I Hope this info will help you:


  •  在IIS上添加网站
  •  配置站点物理路径凭据
  •  启用ASP .Net模拟


这篇关于底层提供程序在Open上失败 - 使用ADO.net实体数据模型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆