尝试创建一个ASP.NET Core项目,因为它刚刚到达RTM。我使用名为“ASP.NET核心Web应用程序(.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 Package Manager的输出:
包Microsoft.AspNetCore.Mvc 1.0.0与。不兼容 netcoreapp1.0(.NETCoreApp,Version = v1.0)。包 Microsoft.AspNetCore.Mvc 1.0.0支持: - net451(.NETFramework,Version = v4.5.1) - netstandard1.6(.NETStandard,Version = v1.6)
答案 0 :(得分:8)
答案 1 :(得分:1)
NetCoreApp需要属于'平台'。
答案 2 :(得分:0)
目标需要是平台: “Microsoft.NETCore.App”:{ “版本”:“1.0.0”, “类型”:“平台” },
答案 3 :(得分:0)
安装最新版本的.Net Core 1.0似乎已经在我的Windows环境中为我做了诀窍。
https://github.com/dotnet/cli/issues/3703
您可以在此处获取最新版本。
答案 4 :(得分:0)
我必须添加这些NuGet提要(不确定是否需要它们)然后重建:
https://dotnet.myget.org/F/dotnet-core/api/v3/index.json
https://dotnet.myget.org/F/dotnet-cli/api/v3/index.json
我是在Visual Studio中完成的: