设置在的MongoDB VNext [英] Setup MongoDB in VNext
问题描述
我在一个VNext项目中使用MongoDB的一些问题
I have some issues using MongoDB in the a VNext project
链接到与code https://github.com/Mech0z/MagicDraftStatistics/ GitHub上树/ NewFeatures
如果我用这个包
mongocsharpdriver
mongocsharpdriver
这是现在已经过时了,我得到
Which is now obsolete, I get
警告'MongoClientExtensions.GetServer(MongoClient)已过时:使用新的API来代替。
Warning 'MongoClientExtensions.GetServer(MongoClient)' is obsolete: 'Use the new API instead.'
和这些6
错误类型或命名空间名称MongoServer'找不到(是否缺少using指令或程序集引用?)
Error The type or namespace name 'MongoServer' could not be found (are you missing a using directive or an assembly reference?)
和我不知道如果我需要改变的东西在我的project.json
And I am not sure if I need to change something in my project.json
"dependencies": {
"Microsoft.AspNet.Server.IIS": "1.0.0-beta1",
"Microsoft.AspNet.Diagnostics": "1.0.0.0-beta1",
"Microsoft.AspNet.Mvc": "6.0.0-beta1",
"mongocsharpdriver": "2.0.0.0-beta2"
的奇怪的是,在GUI不显示任何错误,只有错误列表
The wierd thing is that the GUI do not show any errors, only the Error list
如果我更改为新的官方驱动程序,然后我不能得到相同的code的工作,并为驱动程序的文档好像还没有改变的http://docs.mongodb.org/ecosystem/tutorial/getting-started-with-csharp-driver/
If I change to the new official driver then I cant get the same code to work, and the documentation for the driver dont seem to have changed http://docs.mongodb.org/ecosystem/tutorial/getting-started-with-csharp-driver/
但我得到的
But I get
推荐答案
对于一些奇怪的原因,当我删除aspnetcore50它的工作原理:从框架{}。不知道会产生什么样的影响。
For some odd reason it works when I remove "aspnetcore50": { } from frameworks. Not sure what implications that will have
{
"webroot": "wwwroot",
"version": "1.0.0-*",
"exclude": [
"wwwroot"
],
"packExclude": [
"**.kproj",
"**.user",
"**.vspscc"
],
"dependencies": {
"Microsoft.AspNet.Server.IIS": "1.0.0-beta1",
"Microsoft.AspNet.Diagnostics": "1.0.0.0-beta1",
"Microsoft.AspNet.Mvc": "6.0.0-beta1",
"mongocsharpdriver": "1.8.3"
},
"frameworks": {
"aspnet50": { }
}
}
这篇关于设置在的MongoDB VNext的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!