1

Ich versuche DocumentDB auf asp.net-Core-MVC-App zu verwenden (mit VSCode - Mac OS X) und ich habe Probleme bei der Konfiguration der project.json Datei, sieht meine Konfiguration wie folgt:Require DocumentDB auf asp.net-Kern MVC App

"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" 
    } 

Aber auf die Abhängigkeiten vscode Lösung wirft mich:

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

ich den Code heruntergeladen, die auf dem Beispiel in dem Emulator (für Windows :() und die Abhängigkeit ist verwendet wird wie folgt :

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

Ich habe diese Abhängigkeit überprüft und ist als veraltet gekennzeichnet und es ist nicht wirklich verfügbar.

Wissen Sie, was ist die korrekte Abhängigkeit für die Verwendung von DocumentDB in einer asp.net-Core-App (mit vscode)?

Antwort

1

Derzeit ist DocumentDB .NET Core nur mit Preview-Version verfügbar. Sie benötigen also eine Vorschauversion der DocumentDB .NET Core Client-Bibliothek. Sie können es mit dem Paketmanager nuget hinzufügen.

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

fand ich die Abhängigkeit:

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