【发布时间】:2016-10-31 11:51:52
【问题描述】:
尝试创建一个 ASP.NET Core 项目,因为它刚刚达到 RTM。我使用名为“ASP.NET Core Web Application (.NET Core)”的 Visual Studio 2015 Update 3 模板创建了一个新项目。然后我去了 Nuget 包管理器并将所有 package.json 包更新为 1.0.0。 Visual Studio 无法恢复包,出现本文标题中的错误。
这是更新 Nuget 包后的project.json:
{
"dependencies": {
"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.NETCore.App": "1.0.0"
},
"tools": {
"Microsoft.AspNetCore.Server.IISIntegration.Tools": {
"version": "1.0.0-preview-final",
"imports": "portable-net45+win8+dnxcore50"
}
},
"frameworks": {
"netcoreapp1.0": {
"imports": [
"dotnet5.6",
"dnxcore50",
"portable-net45+win8"
]
}
},
"buildOptions": {
"emitEntryPoint": true,
"preserveCompilationContext": true
},
"runtimeOptions": {
"gcServer": true
},
"publishOptions": {
"include": [
"wwwroot",
"Views",
"appsettings.json",
"web.config"
]
},
"scripts": {
"postpublish": [ "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" ]
}
}
Nuget 包管理器的输出:
包 Microsoft.AspNetCore.Mvc 1.0.0 不兼容 netcoreapp1.0 (.NETCoreApp,版本=v1.0)。包裹 Microsoft.AspNetCore.Mvc 1.0.0 支持: - net451 (.NETFramework,版本=v4.5.1) - netstandard1.6 (.NETStandard,Version=v1.6)
【问题讨论】:
标签: asp.net-core