2017-03-14 111 views
1

在編譯發佈到新項目時發生此錯誤。使用淨4.52爲主要框架,一些較舊的套裝(晴貝寶)Microsoft.Composition 1.0.27與.NETCoreApp不兼容,版本= v1.0

我已經讀了很多使用框架「導入」部分的其他職位,但這個並沒有在我的情況下,爲幫助過來這個問題。

錯誤消息:

包Microsoft.Composition 1.0.27不與 netcoreapp1.0(.NETCoreApp,版本= 1.0)兼容。

包 Microsoft.Composition 1.0.27載體:便攜式net45 + win8的+ WP8 + wpa81 (.NETPortable,版本= V0.0,檔案= Profile259)

Project.Json:

"dependencies": { 
    "BundlerMinifier.Core": "2.2.306", 
    "MailKit": "1.10.2", 
    "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.1", 
    "Microsoft.AspNetCore.Server.IISIntegration": "1.0.0", 
    "Microsoft.AspNetCore.Server.Kestrel": "1.1.0", 
    "Microsoft.AspNetCore.Http.Features": "1.1.0", 
    "Microsoft.AspNetCore.StaticFiles": "1.1.0", 
    "Microsoft.EntityFrameworkCore.SqlServer": "1.1.0", 
    "Microsoft.EntityFrameworkCore.SqlServer.Design": "1.1.0", 
    "Microsoft.Extensions.Configuration.EnvironmentVariables": "1.1.0", 
    "Microsoft.Extensions.Configuration.Json": "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", 
    "PayPal": "1.8.0", 
    "Microsoft.AspNetCore.Http": "1.1.0", 
    "Microsoft.VisualStudio.Web.CodeGenerators.Mvc": "1.1.0-preview4-final", 
    "Microsoft.VisualStudio.Web.CodeGeneration.Tools": "1.1.0-preview4-final", 
    "Microsoft.EntityFrameworkCore.Tools": "1.0.0-preview2-final", 
    "Microsoft.AspNetCore.Session": "1.0.0" 
    }, 
    "tools": { 
    "BundlerMinifier.Core": "2.2.281", 
    "Microsoft.EntityFrameworkCore.Tools": "1.0.0-preview2-final", 
    "Microsoft.VisualStudio.Web.CodeGenerators.Mvc": "1.1.0-msbuild3-final", 
    "Microsoft.AspNetCore.Server.IISIntegration.Tools": "1.1.0-preview4-final", 
    "Microsoft.VisualStudio.Web.CodeGeneration.Tools": "1.1.0-preview4-final" 
    }, 

    "frameworks": { 
     "net452": { 
     "imports": [ "dnxcore50", "portable-net45+win8" ] 
     } 
    }, 

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

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

    "scripts": { 
    "prepublish": [ "bower install", "dotnet bundle" ], 
    "postpublish": [ "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" ] 
    } 
+0

的可能的複製[依賴性Microsoft.Composition 1.0.27不支持框架.NETCoreApp,版本= V1.1(HTTP:/ /stackoverflow.com/questions/40846326/the-dependency-microsoft-composition-1-0-27-does-not-support-framework-netcorea) –

回答

0

編輯project.JSON具有以下固定我的問題:

"dependencies": { 
    "BundlerMinifier.Core": { 
     "version": "2.2.281", 
     "type": "build", 
     "imports": [ "portable-net45+win8+wp8+wpa81" ] 
    }, 
    "MailKit": "1.10.2", 
    "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.1", 
    "Microsoft.AspNetCore.Server.IISIntegration": "1.0.0", 
    "Microsoft.AspNetCore.Server.Kestrel": "1.1.0", 
    "Microsoft.AspNetCore.Http.Features": "1.1.0", 
    "Microsoft.AspNetCore.StaticFiles": "1.1.0", 
    "Microsoft.EntityFrameworkCore.SqlServer": "1.1.0", 
    "Microsoft.EntityFrameworkCore.SqlServer.Design": "1.1.0", 
    "Microsoft.Extensions.Configuration.EnvironmentVariables": "1.1.0", 
    "Microsoft.Extensions.Configuration.Json": "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.AspNetCore.Http": "1.1.0", 
    "Microsoft.VisualStudio.Web.CodeGenerators.Mvc": { 
     "version": "1.1.0-msbuild3-final", 
     "type": "build", 
     "imports": [ "portable-net45+win8+wp8+wpa81" ] 
    }, 

    "Microsoft.VisualStudio.Web.CodeGeneration.Tools": { 
     "version": "1.1.0-preview4-final", 
     "type": "build", 
     "imports": [ "portable-net45+win8+wp8+wpa81" ] 
    }, 
    "Microsoft.EntityFrameworkCore.Tools": { 
     "version": "1.0.0-preview2-final", 
     "type": "build", 
     "imports": [ "portable-net45+win8+wp8+wpa81" ] 
    }, 
    "Microsoft.AspNetCore.Session": "1.0.0", 
    "PayPal": "1.8.0" 
    }, 

    "tools": { 
    "BundlerMinifier.Core": { 
     "version": "2.2.281", 
     "type": "build", 
     "imports": [ "portable-net45+win8+wp8+wpa81" ] 
    }, 
    "Microsoft.EntityFrameworkCore.Tools": { 
     "version": "1.0.0-preview2-final", 
     "type": "build", 
     "imports": [ "portable-net45+win8+wp8+wpa81" ] 
    }, 
    "Microsoft.VisualStudio.Web.CodeGenerators.Mvc": { 
     "version": "1.1.0-msbuild3-final", 
     "type": "build", 
     "imports": [ "portable-net45+win8+wp8+wpa81" ] 
    }, 
    "Microsoft.AspNetCore.Server.IISIntegration.Tools": { 
     "version": "1.1.0-preview4-final", 
     "type": "build", 
     "imports": [ "portable-net45+win8+wp8+wpa81" ] 
    }, 
    "Microsoft.VisualStudio.Web.CodeGeneration.Tools": { 
     "version": "1.1.0-preview4-final", 
     "type": "build", 
     "imports": [ "portable-net45+win8+wp8+wpa81" ] 
    } 
    }, 

    "frameworks": { 
    "net452": { 
     "imports": [ "dnxcore50", "portable-net45+win8+wp8+wpa81" ] 
    } 
    }, 

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

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

    "scripts": { 
    "prepublish": [ "bower install", "dotnet bundle" ], 
    "postpublish": [ "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" ] 
    } 
-1

該消息正好描述了該問題。您的項目正在瞄準.Net Core 1.0,並且該軟件包與其不兼容。

發生這種情況是因爲並非所有.Net平臺和版本都兼容。例如.Net Core 1.0只兼容.Net Standard 1.6。這page顯示了一個表與不同的.Net平臺之間的兼容性。

在這個特定的情況下,你的目標是.net核心1.0和包是目標4.5。這些與您在表格中看到的不兼容。