Asp.net core ASP.NET Core 1.0.1中断项目
如果我使用Visual Studio 2015 Update 3创建一个新的ASP.NET核心MVC应用程序,它运行得很好。但是,如果我使用上述应用程序并将其Nuget软件包更新为ASP.NET Core 1.0.1,则会出现以下生成错误:Asp.net core ASP.NET Core 1.0.1中断项目,asp.net-core,Asp.net Core,如果我使用Visual Studio 2015 Update 3创建一个新的ASP.NET核心MVC应用程序,它运行得很好。但是,如果我使用上述应用程序并将其Nuget软件包更新为ASP.NET Core 1.0.1,则会出现以下生成错误: Can not find runtime target for framework '.NETCoreApp,Version=v1.0' compatible with one of the target runtimes: 'win10-x64, win8
Can not find runtime target for framework '.NETCoreApp,Version=v1.0' compatible with one of the target runtimes: 'win10-x64, win81-x64, win8-x64, win7-x64'. Possible cause
1. The project has not been restored or restore failed - run `dotnet restore`
2. The project does not list one of 'win10-x64, win81-x64, win8-x64, win7-x64' in the 'runtimes' section.
3. You may be trying to publish a library, which is not supported. Use `dotnet pack` to distribute libraries.
这是虫子,还是环境问题
附录:
还原中的日志看起来很正常:
log : Restoring packages for <path to project>\project.json...
log : Restoring packages for tool 'Microsoft.AspNetCore.Server.IISIntegration.Tools' in E:\Software Projects\subq\src\SubQ.API\project.json...
log : Lock file has not changed. Skipping lock file write. Path: <path to project>\project.lock.json
log : <path to project>\project.json
log : Restore completed in 6210ms.
安装了最新的SDK。我认为
运行时
应该放在框架
设置之外。改变
"frameworks": {
"netcoreapp1.0": {
"imports": [
"dotnet5.6",
"portable-net45+win8"
],
"runtimes": {
"win10-x64": {}
}
}
},
到
我还必须添加win81-x64
,因为我运行的是windows8.1,而编译器对此表示不满
让我知道这是否有效 根据:
使用nuget更新时,“类型”:“平台”被删除,这将有效地将项目更改为独立项目,从而强制要求运行时部分
对于我来说,手动向project.json文件添加“type”:“platform”解决了这个问题
"dependencies": {
"Microsoft.NETCore.App": {
"version": "1.0.1",
"type": "platform"
},
并据此:
通过NuGet UI对项目系统进行更新,以更新project.json,“type”:“platform”在编辑过程中被删除。NuGet 3.5.0 RTM(尚未发布)将有解决此问题的方法。是否安装了.NET Core 1.0.1 SDK?另外,请尝试在project.json所在的文件夹中运行
dotnet restore
命令。@Tseng:是,我已经安装了它。@Ignas:是。Visual Studio在生成期间运行还原,我已经从命令行手动运行了它。Ok。这是正确的模式。我见过一些对运行时对象的引用,但从未在整个文件的上下文中见过。有一次我确实看到了它,它被嵌入到了框架下。也许这适用于早期版本。无论如何,谢谢你@KETCH:请查阅可用的模式。json以及其他基于json的配置在其模式中列出。最新的project.json位于此处:@Tseng Cool resource。谢谢
"frameworks": {
"netcoreapp1.0": {
"imports": [
"dotnet5.6",
"portable-net45+win8"
]
}
},
"runtimes": {
"win10-x64": {},
"win81-x64": {}
},
"dependencies": {
"Microsoft.NETCore.App": {
"version": "1.0.1",
"type": "platform"
},