wpf ADO.NET实体数据模型BUG

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/16901708/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-13 08:54:57  来源:igfitidea点击:

ADO.NET Entity Data Model BUG

c#wpfvisual-studio-2010ado.net-entity-data-model

提问by wpf c

I have a project in visual studio ultimate 2010 (MVVM) and database, in SQLITE.

我在 SQLITE 中的 Visual Studio Ultimate 2010 (MVVM) 和数据库中有一个项目。

Everything worked fine, but now I have a problem with the ADO.NET Entity Data Model.

一切正常,但现在我遇到了 ADO.NET 实体数据模型的问题。

I searched for information about this and have not found much .. Every time I want to open the wizard, it just closes.

我搜索了有关此的信息,但没有找到太多..每次我想打开向导时,它都会关闭。

I think I should reinstall Visual Studio, but before doing so if anyone has had this error before and know what can be, I'd be grateful.

我想我应该重新安装 Visual Studio,但在此之前,如果有人之前遇到过此错误并且知道可能是什么错误,我将不胜感激。

回答by George Johnston

I've found this can be a bug with third party data adapters being left in strange states. Open your View > Server Explorerand remove your third-party data connections. Then, try opening the wizard again.

我发现这可能是第三方数据适配器处于奇怪状态的错误。打开View > Server Explorer并删除您的第三方数据连接。然后,再次尝试打开向导。

回答by chiefcoder

I had this problem with VS 2013 (Entity Model Wizard disappearing). I solved it by first uninstalling the MySQL .NET/Connector (I had 6.8.3) and installing it back, and then retrying the wizard. Wizard completes and I could select tables etc.

我在 VS 2013 中遇到了这个问题(实体模型向导消失了)。我通过首先卸载 MySQL .NET/Connector(我有 6.8.3)并重新安装它来解决它,然后重试向导。向导完成,我可以选择表格等。

回答by Rob Powell

If you are creating a web application such as through MVC check the AttachDBFilenamein web.configfor characters such as |.

如果您正在创建一个Web应用程序,例如通过MVC检查AttachDBFilenameweb.config的字符如|。

I had the same issue and was unable to resolve it by removing connections from Server Explorer.

我遇到了同样的问题,无法通过从服务器资源管理器中删除连接来解决它。

I attached a visual studio debugger to visual studios.

我将视觉工作室调试器附加到视觉工作室。

Turned on CLI exceptions and turned off Just my Code.

打开 CLI 异常并关闭仅我的代码。

I then saw the hidden exception.

然后我看到了隐藏的异常。

The wizard was throwing an exception with the message "Invalid Character in Path" in System.IO.Path.CheckInvalidPathChars(string path, bool checkAdditional).

向导抛出异常,消息为“ Invalid Character in PathSystem.IO.Path.CheckInvalidPathChars(string path, bool checkAdditional).

The value of path was "|DataDirectory|\\aspnet-Mvs4Dummy1-20140402113853.mdf".

路径的价值是 "|DataDirectory|\\aspnet-Mvs4Dummy1-20140402113853.mdf".

I realised that this was the database that visual studios had automatically generated with my MVC application and that the offending character was probably the '|'symbol.

我意识到这是 Visual Studios 用我的 MVC 应用程序自动生成的数据库,并且有问题的字符可能是'|'符号。

So I performed a Grep search of my directory and found that this was being stored in my web.config in this apparently unsupported format.

所以我对我的目录进行了 Grep 搜索,发现它以这种显然不受支持的格式存储在我的 web.config 中。

I changed the entry to a full local path and the wizard stopped disappearing.

我将条目更改为完整的本地路径,向导停止消失。

回答by Taha Karaca

Open VS, View->Server Explorer and delete connections under the data connection files. I had already this error before and solve it doing like this.

打开VS,查看->服务器资源管理器,删除数据连接文件下的连接。我之前已经遇到过这个错误,并像这样解决它。

回答by John M

My solution for VS2015 was:

我对 VS2015 的解决方案是:

Install MySQL.NET Connector 6.9.8 to replace 6.9.5.

安装 MySQL.NET 连接器 6.9.8 以替换 6.9.5。

I already has installed MySQL for Visual Studio 1.2.6 and had got the appropratiate MySQL NuGet packages (MySQL.Data, MySQL.Data.Entity.EF6, MySQL.Web).

我已经为 Visual Studio 1.2.6 安装了 MySQL,并且已经获得了合适的 MySQL NuGet 包(MySQL.Data、MySQL.Data.Entity.EF6、MySQL.Web)。

回答by Loc Huynh

I solved the problem by doing some steps below: 1/ Open "Server Explorer" window in Visual Studio 2/ Delete all Connections under "Data Connections" sections 3/ Then, Add the ADO.net Entity Data Model as normal

我通过执行以下一些步骤解决了这个问题:1/ 在 Visual Studio 中打开“服务器资源管理器”窗口 2/ 删除“数据连接”部分下的所有连接 3/ 然后,像往常一样添加 ADO.net 实体数据模型

回答by Kurubaran

Try deleting the following file

尝试删除以下文件

c:\users\myusername\appdata\roaming\microsoft\visualstudio\10.0\SeverExplorer\DefaultView.SEView.

c:\users\myusername\appdata\roaming\microsoft\visualstudio\10.0\SeverExplorer\DefaultView.SEView。