2017-02-10 11 views
0

私はasp.net core web apiをnginxにデプロイしようとしました。ウェブAPIプロジェクトはクラスライブラリを参照しています。クラスライブラリには、NugetのMySql.Dataパッケージがインストールされています。プロジェクト全体をubuntuにコピーして "dotnet restore"コマンドを実行すると、このステップではすべて正常に動作します。しかし、私が 'dotnet publish'コマンドを実行すると、エラーが出る:依存関係MySql.Data> = 7.0.6-ir31を解決できませんでした

.NETスタンダード版、バージョン= v1.6 /home/.../project.jsonのApp.DAL.Coreのコンパイル:エラーNU1001:依存関係MySql.Data> = 7.0.6-ir31は、私は、IR、それでも動作しないためにIRを変更

MySQL -> .NET Core Dependency error (MySql.Data)

をこのスレッドをチェックしている

を解決できませんでした。私project.jsonファイル

DAL.Core Porject.json Project.json

{ 
    "dependencies": { 
    "Microsoft.ApplicationInsights.AspNetCore": "1.0.0", 
    "Microsoft.AspNetCore.Mvc": "1.0.0", 
    "Microsoft.AspNetCore.Server.IISIntegration": "1.0.0", 
    "Microsoft.AspNetCore.Server.Kestrel": "1.0.0", 
    "Microsoft.Extensions.Configuration.EnvironmentVariables": "1.0.0", 
    "Microsoft.Extensions.Configuration.FileExtensions": "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", 
    "log4net": "2.0.7", 
    "Newtonsoft.Json": "9.0.1", 
    "App.DAL.Core": "1.0.0-*", 
    "MySql.Data": "7.0.6-ir31", 
    "Microsoft.AspNetCore.Mvc.WebApiCompatShim": "1.0.0", 
    "System.Net.Http": "4.1.0", 
    "System.Text.Encoding": "4.3.0", 
    "Microsoft.AspNetCore.Mvc.Core": "1.0.0", 
    "System.Net.Requests": "4.0.11", 
    "Microsoft.NETCore.App": "1.0.0" 
    }, 

    "tools": { 
    "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/**/Views", 
     "appsettings.json", 
     "web.config" 
    ] 
    }, 

    "scripts": { 
    "postpublish": [ "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" ] 
    }, 

    "runtimes": { 
    "ubuntu.14.04-x64": {} 
    } 
} 

誰でも助けることができる

{ 
    "version": "1.0.0-*", 

    "dependencies": { 
    "MySql.Data": "7.0.6-ir31", 
    "NETStandard.Library": "1.6.0" 
    }, 

    "frameworks": { 
    "netstandard1.6": { 
     "imports": "dnxcore50" 
    } 
    } 
} 

のWeb APIを参照してください? DAL.Coreプロジェクトのproject.jsonファイルに以下のコードを追加

+0

を解決し、あなたは両方の場所でそれを変更しましたか?あなたのクラスライブラリとアプリケーションに参照があります – Tseng

+0

確かに、2つのproject.jsonファイルが変更されました – Allen4Tech

+0

また、project.lock.jsonファイルの両方がIR31からir31に変更されているのがわかります – Allen4Tech

答えて

0

は問題に

"runtimes": { 
 
    "ubuntu.14.04-x64": {} 
 
    }

関連する問題