问题
I have some issues using MongoDB in the a VNext project
Link to github with code https://github.com/Mech0z/MagicDraftStatistics/tree/NewFeatures
If I use this package
mongocsharpdriver
Which is now obsolete, I get
Warning 'MongoClientExtensions.GetServer(MongoClient)' is obsolete: 'Use the new API instead.'
and 6 of these
Error The type or namespace name 'MongoServer' could not be found (are you missing a using directive or an assembly reference?)
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"
The wierd thing is that the GUI do not show any errors, only the Error list

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

回答1:
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": { }
}
}
来源:https://stackoverflow.com/questions/28663047/setup-mongodb-in-vnext