简体   繁体   English

无法使用EF 5和VS 2015从数据库更新模型

[英]Failure to update model from database using EF 5 and VS 2015

I have a C# application using Oracle database and Entity Framework 5. Oracle client is version 12c R1. 我有一个使用Oracle数据库和实体框架5的C#应用​​程序.Oracle客户端是版本12c R1。 My application uses database first approach. 我的应用使用数据库优先方法。 I'm trying to run the app using Visual Studio Enterprise 2015. When I access the edmx file and I try to update the model from the database, it gives me the following error: 我正在尝试使用Visual Studio Enterprise 2015运行应用程序。当我访问edmx文件并尝试从数据库更新模型时,它会给我以下错误:

An exception of type 'System.ArgumentException' occurred while attempting to update from the database. 尝试从数据库更新时发生“System.ArgumentException”类型的异常。 The exception message is: 'Unable to convert runtime connection string to its design-time equivalent. 异常消息是:'无法将运行时连接字符串转换为其设计时等效项。 The libraries required to enable Visual Studio to communicate with the database for design purposes (DDEX provider) are not installed for provider 'Oracle.DataAccess.Client'. 未为提供程序“Oracle.DataAccess.Client”安装使Visual Studio与数据库进行通信以进行设计所需的库(DDEX提供程序)。 Connection string: XXXXX. 连接字符串:XXXXX。

This error does not occur when I use Visual Studio Ultimate 2013. Only on Visual Studio Enterprise 2015. 使用Visual Studio Ultimate 2013时不会发生此错误。仅在Visual Studio Enterprise 2015上。

Is there any known incompatibility issue with the new one? 是否存在新的不兼容问题?

I believe it is because not yet out ODT version compatible with Visual Studio 2015. Wait or will have no choice for now? 我相信这是因为还没有与Visual Studio 2015兼容的ODT版本。等等或现在别无选择?

Oracle Developer Tools Oracle开发人员工具

I installed the Oracle Developer Tools for 2015 but still could not get this to work. 我安装了适用于2015的Oracle开发人员工具,但仍无法使其工作。 When I would attempt to do an Update Model from Database with Entity Framework, I encountered this error below. 当我尝试使用实体框架从数据库执行更新模型时,我在下面遇到此错误。

在此输入图像描述

So I did as instructed and removed all references to Oracle from the GAC, even following advice here Oracle .Net Developer's Guide , but it still didn't work. 所以我按照指示执行并删除了GAC中对Oracle的所有引用,甚至遵循Oracle .Net Developer's Guide中的建议 ,但它仍然无效。 Being that I'm on a tight schedule and don't have time to fool with this, I opened my solution in VS2012, did my Entity Framework changes, and then reopened the solution in VS2015, and that worked fine. 由于我的时间紧迫,没有时间愚弄这个,我在VS2012中打开了我的解决方案,我的实体框架发生了变化,然后在VS2015中重新打开了解决方案,这很好用。 Irritating, but at least I have a workaround for now. 刺激,但至少我现在有一个解决方法。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM