2017-02-20 23 views
0

私は現在、apiで作業しており、jwt認証を使用するにはこのパッケージをインストールする必要があります。唯一の問題は、私がそれを機能させることができないことです。ここ は、エラーの絵を行く: enter image description hereMicrosoft.AspNetCore.Authentication.JwtBearer依存関係を解決できませんでした

そして、ここでは私のproject.jsonのコピーを行く:エラーが復元DOTNET

"dependencies": { 
    "Microsoft.NETCore.App": { 
     "version": "1.0.1", 
     "type": "platform" 
    }, 
    "Microsoft.AspNetCore.Diagnostics": "1.0.0", 
    "Microsoft.AspNetCore.Mvc": "1.0.0", 
    "Microsoft.AspNetCore.Razor.Tools": { 
     "version": "1.0.0-preview2-final", 
     "type": "build" 
    }, 
    "Microsoft.AspNetCore.Server.IISIntegration": "1.0.0", 
    "Microsoft.AspNetCore.Server.Kestrel": "1.0.0", 
    "Microsoft.AspNetCore.StaticFiles": "1.0.0", 
    "Microsoft.Extensions.Configuration.EnvironmentVariables": "1.0.0", 
    "Microsoft.Extensions.Configuration.Json": "1.0.0", 
    "Microsoft.Extensions.Logging": "1.0.0", 
    "Microsoft.Extensions.Logging.Console": "1.0.0", 
    "Microsoft.Extensions.Logging.Debug": "1.0.0", 
    "Microsoft.Extensions.Options.ConfigurationExtensions": "1.0.0", 
    "Microsoft.VisualStudio.Web.BrowserLink.Loader": "14.0.0", 
    "Core": "1.0.0-*", 
    "Dtos": "1.0.0-*", 
    "BundlerMinifier.Core": "2.2.281", 
    "Microsoft.AspNetCore.Identity.EntityFrameworkCore": "1.0.0", 
    "AutoMapper": "5.2.0", 
    "AutoMapper.Extensions.Microsoft.DependencyInjection": "1.1.0", 
    "MongoDb": "1.0.0-*", 
    "Core.DAL": "1.0.0-*", 
    "PusherServer": "4.0.0-rc1", 
    "Core.Documents": "1.0.0-*", 
    "Core.Entities": "1.0.0-*", 
    "Core.Automapper": "1.0.0-*", 
    "Microsoft.AspNetCore.Authentication": "1.0.0", 
    "Microsoft.AspNetCore.Authentication.JwtBearer": "1.0.0" 
    }, 

    "tools": { 
    "BundlerMinifier.Core": "2.0.238", 
    "Microsoft.AspNetCore.Razor.Tools": "1.0.0-preview2-final", 
    "Microsoft.AspNetCore.Server.IISIntegration.Tools": "1.0.0-preview2-final" 
    }, 

    "frameworks": { 
    "netcoreapp1.0": { 
     "imports": [ 
     "dotnet5.6", 
     "portable-net45+win8" 
     ] 
    } 
    }, 

    "buildOptions": { 
    "emitEntryPoint": true, 
    "preserveCompilationContext": true 
    }, 

    "runtimeOptions": { 
    "configProperties": { 
     "System.GC.Server": true 
    } 
    }, 

    "publishOptions": { 
    "include": [ 
     "wwwroot", 
     "Views", 
     "Areas", 
     "Areas/**/Views", 
     "appsettings.json", 
     "appsettings.production.json", 
     "appsettings.development.json", 
     "bundleconfig.json", 
     "web.config" 
    ] 
    }, 

    "scripts": { 
    "prepublish": [ "bower install", "dotnet bundle" ], 
    "postpublish": [ "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" ] 
    }, 
    "runtimes": { 
    "win10-x64": {}, 
    "win8-x86": {}, 
    "win7-x86": {} 
    } 
} 

例外:

PATH=.\node_modules.bin;C:\Program Files (x86)\Microsoft Visual Studio 14.0\Web\External;%PATH%;C:\Program Files (x86)\Microsoft Visual Studio 14.0\Web\External\git C:\Program Files\dotnet\dotnet.exe restore "C:\Users\Andoni Zubizarreta\Documents\Projects\DeepMarket.vs\restore.dg" C:\Users\Andoni Zubizarreta\Documents\Projects\DeepMarket.vs\restore.dg(1,1): error MSB4025: The project file could not be loaded. Data at the root level is invalid. Line 1, position 1.

せて頂きますあなたが何かもっと必要があるかどうかを知る。前もって感謝します。

+0

私はあなたの 'project.json'をコピーして新しいプロジェクトに貼り付け、それをうまくビルドしました。 'dotnet restore'の結果を投稿して、エラーの内容を確認できますか? –

+0

@A.Bello助けてくれてありがとう。私はそれが奇妙なエラーであることを知っている、私はエラーで質問を更新しました。 –

答えて

1

私は、パッケージマネージャコンソールで手動でdotnet restoreを実行することで問題を解決しました。 Visual Studioにパッケージを自動的に復元するのに問題があるようです。助けてくれてありがとう。