.NET核心的MySql [英] .Net Core MySql
问题描述
我刚刚开始在Visual Studio代码与.NET核心编码,在Ubuntu 14.04.4
我已经习惯了这两种使用Ubuntu(从个人兴趣,爱好等),.NET和Visual Studio在工作中。
但我已经遇到一个问题我似乎无法克服。我建设,我想用MySQL服务器通信的小型控制台应用程序,但我似乎无法得到MySql.ConnectorNET.Data正常工作。
它被安装使用命令 DNU安装MySql.ConnectorNET.Data code>这似乎正常工作。这种依赖性在project.json文件中添加的,和智能是能够穿越包就好了,但OmniSharp日志报告:
[信息:OmniSharp.Dnx.DnxProjectSystem]项目/home/<username>/VSCode/SimpleSQLatmpt/project.json有这些未解决的引用:MySql.ConnectorNET.Data
和我似乎根本无法修理好了。 VSCode似乎检测到它,并要求我运行 DNU恢复
命令。但是这无济于事。对于所有的打算和目标好像MySql.ConnectorNET.Data可在项目,但就是无法使用。
任何一个可以告诉我如何修复这个?
同样重要的是,为什么它是摆在首位发生?
非常感谢您的宝贵时间。
< DIV CLASS =h2_lin>解决方案
目前这个问题的时候(MAR 2016)有对MySQL没有.NET核心兼容ADO.NET提供商。
现在情况发生变化:
- 的 MySqlConnector 的书面布拉德利固安捷 - 麻省理工学院的许可,并提供了完整的支持异步
- 的 MySql.Data.Core 通过甲骨文(传统上,GPL)
提供
我个人更喜欢MySqlConnector - 它可以在商业项目中免费使用(MIT许可);还我已经与我的 NReco.Data A> Linux下的库来测试的,它完美的作品在我的scenarious。不幸的是,MySqlConnector不支持EF核心呢。
---更新 -
还有一个核心的.NET兼容的MySQL连接器+ EF核心MySQL的供应商
- Pomelo.Data.MySql (遗憾的是它并没有实现真正的异步行为)
- 的 Pomelo.EntityFrameworkCore.MySql
I've just started coding in Visual Studio Code with .NET Core, on Ubuntu 14.04.4 I'm used to both using Ubuntu (from personal interests, hobby, etc) and .NET and Visual Studio at work.
But I've run into a problem i can't seem to overcome. I'm building a small console app that i want to communicate with a MySql Server, but I can't seem to get the MySql.ConnectorNET.Data working properly.
It was installed with the command dnu install MySql.ConnectorNET.Data
And that seemed to work fine. The dependency was added in the project.json file, and intellisense was able to traverse the package just fine, but the OmniSharp Log reports that:
[INFORMATION:OmniSharp.Dnx.DnxProjectSystem] Project /home/<username>/VSCode/SimpleSQLatmpt/project.json has these unresolved references: MySql.ConnectorNET.Data
and I simply can't seem to fix that. VSCode seems to detect it, and asks me to run the dnu restore
command. But it's to no avail. For all intends and purposes it seems like MySql.ConnectorNET.Data is available in the project, but just can't be used.
Can any one tell me how to fix this? And just as important, why it is happening in the first place?
Thank you very much for your time.
At the time of this question (Mar 2016) there was no .NET Core-compatible ADO.NET provider for MySQL.
Now situation is changed:
- MySqlConnector written by Bradley Grainger -- licensed under MIT, and offers full async support
- MySql.Data.Core provided by Oracle (traditionally, GPL)
Personally I prefer MySqlConnector -- it can be used in commercial projects for free (MIT license); also I've tested it with my NReco.Data library under Linux, and it works perfectly in my scenarious. Unfortunately, MySqlConnector doesn't support EF Core yet.
--- UPDATE --
One more .NET Core-compatible MySQL connector + EF Core MySQL provider:
- Pomelo.Data.MySql (unfortunately it doesn't implement true async behaviour)
- Pomelo.EntityFrameworkCore.MySql
这篇关于.NET核心的MySql的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!