在为新项目编译发布时遇到此错误。使用 .Net 4.52 作为一些较旧软件包的主要框架(主要是Paypal)
我已经阅读了很多其他帖子,使用了框架中的“导入”部分,但这对我的问题没有帮助。#/ p>
错误消息:
包Microsoft.Composition 1.0.27与。不兼容 netcoreapp1.0(.NETCoreApp,Version = v1.0)。
包 Microsoft.Composition 1.0.27支持:portable-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 :(得分:0)
使用以下修复的问题编辑project.JSON:
public class Checked extends Thread {
public void run() {
for (int i = 0; i <= 5; i++) {
MainForm.intVerifiedNews ++;
//Here you need to pass the intVerifiedNews value to the Label
System.out.println(MainForm.intVerifiedNews);
}
}
}
答案 1 :(得分:-1)
该消息准确描述了该问题。您的项目目标是.Net Core 1.0,并且该软件包与它不兼容。
这是因为并非所有.Net平台和版本都兼容。例如.Net Core 1.0仅与.Net Standard 1.6兼容。此page显示了一个表,其中包含不同.Net平台之间的兼容性。
在这种特定情况下,您的目标是.Net Core 1.0,而目标是4.5。这些不兼容,如表中所示。