简体   繁体   中英

Require DocumentDB on asp.net-core MVC App

I'm trying to use DocumentDB on asp.net-core MVC App (using VSCode - Mac OS X) and I'm having trouble configuring the project.json file, my configuration looks as follows:

"dependencies": {
    "Microsoft.NETCore.App": {
      "version": "1.1.0",
      "type": "platform"
    },
    "Microsoft.AspNetCore.Authentication.Cookies": "1.1.0",
    "Microsoft.AspNetCore.Diagnostics": "1.1.0",
    "Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore": "1.1.0",
    "Microsoft.AspNetCore.Identity.EntityFrameworkCore": "1.1.0",
    "Microsoft.AspNetCore.Mvc": "1.1.0",
    "Microsoft.AspNetCore.Razor.Tools": {
      "version": "1.1.0-preview4-final",
      "type": "build"
    },
    "Microsoft.AspNetCore.Routing": "1.1.0",
    "Microsoft.AspNetCore.Server.IISIntegration": "1.1.0",
    "Microsoft.AspNetCore.Server.Kestrel": "1.1.0",
    "Microsoft.AspNetCore.StaticFiles": "1.1.0",
    "Microsoft.EntityFrameworkCore.Sqlite": "1.1.0",
    "Microsoft.EntityFrameworkCore.Sqlite.Design": {
      "version": "1.1.0",
      "type": "build"
    },
    "Microsoft.EntityFrameworkCore.Tools": {
      "version": "1.1.0-preview4-final",
      "type": "build"
    },
    "Microsoft.Extensions.Configuration.EnvironmentVariables": "1.1.0",
    "Microsoft.Extensions.Configuration.Json": "1.1.0",
    "Microsoft.Extensions.Configuration.CommandLine": "1.1.0",
    "Microsoft.Extensions.Configuration.UserSecrets": "1.1.0",
    "Microsoft.Extensions.Logging": "1.1.0",
    "Microsoft.Extensions.Logging.Console": "1.1.0",
    "Microsoft.Extensions.Logging.Debug": "1.1.0",
    "Microsoft.Extensions.Options.ConfigurationExtensions": "1.1.0",
    "Microsoft.VisualStudio.Web.BrowserLink.Loader": "14.1.0",
    "Microsoft.VisualStudio.Web.CodeGeneration.Tools": {
      "version": "1.1.0-preview4-final",
      "type": "build"
    },
    "Microsoft.VisualStudio.Web.CodeGenerators.Mvc": {
      "version": "1.1.0-preview4-final",
      "type": "build"
    },
    "Microsoft.Azure.DocumentDB": "1.11.0"
  }

But on solving the dependencies vscode throws me:

 Package Microsoft.Azure.DocumentDB 1.11.0 is not compatible with netcoreapp1.0 (.NETCoreApp,Version=v1.0). 

I downloaded the code that's used on the example in the emulator (for Windows :() and the dependency is as follows:

 "Microsoft.Azure.Documents.Client": "0.1.0"

I checked that dependency and is marked as deprecated and it's not really available.

Do you know what is the correct Dependency for using DocumentDB in a asp.net-core app (using vscode)?

Currently DocumentDB .NET Core is available with preview version only. So you need preview version of the DocumentDB .NET Core client library. You can add it using nuget package manager.

PM> Install-Package Microsoft.Azure.DocumentDB.Core -Pre

我发现了依赖性:

 "Microsoft.Azure.DocumentDB.Core": "0.1.0-preview"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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