VS2015 ASP.NET 5 beta7 依赖无法解决
VS2015 ASP.NET 5 beta7 dependency could not be resolved
这是 的后续。我从 VS2015 社区中的一个空 ASP.NET 项目开始,尝试根据教程添加几个包,但还没有让它真正起作用。链接问题中的最初问题是由于一些项目依赖使用 beta5
和一些使用 beta7
。匹配这些解决了这个问题,但是现在当我尝试 运行 IIS Express 中的项目时出现此错误:
Could not load file or assembly 'Microsoft.Dnx.Host.Clr' or one of its dependencies.
我认为问题仍然与版本相关——就像之前的 web.config
程序集参考问题一样——但我还不知道如何处理它。我尝试根据在 GitHub 上发现的类似问题修改 global.json
,但现在它无法构建。我猜它似乎找不到更新版本的 CLR。来自 VS2015 中的错误列表:
The dependency Microsoft.AspNet.Mvc >= 6.0.0-beta7 could not be resolved.
The dependency Microsoft.AspNet.Server.IIS >= 1.0.0-beta7 could not be resolved.
The dependency Microsoft.AspNet.Server.WebListener >= 1.0.0-beta7 could not be resolved.
global.json
:
{
"projects": [ "src", "test" ],
"sdk": {
"version": "1.0.0-beta7",
"runtime": "clr",
"architecture": "x86"
}
}
我的项目的引用树有黄色错误指示器,但在 NuGet 包管理器中查找我的项目没有显示任何升级(或据我所知根本没有安装任何东西)。
dnvm list
:
1.0.0-beta5 clr x64
1.0.0-beta5 clr x86
1.0.0-beta5 coreclr x64
1.0.0-beta5 coreclr x86
* 1.0.0-beta7 clr x86 default
1.0.0-beta8-15585 clr x86
dnu list
:
Microsoft .NET Development Utility CLR-x86-1.0.0-beta7-15532
我已经重新启动 VS,但没有帮助。在我的 global.json
中改回 beta5
使其成功编译,但随后出现 IIS 错误。
project.json
:
{
"webroot": "public",
"version": "1.0.0-*",
"dependencies": {
"Microsoft.AspNet.Mvc": "6.0.0-beta7",
"Microsoft.AspNet.Server.IIS": "1.0.0-beta7",
"Microsoft.AspNet.Server.WebListener": "1.0.0-beta7"
},
"commands": {
"web": "Microsoft.AspNet.Hosting --config hosting.ini"
},
"frameworks": {
"dnx451": { },
"dnxcore50": { }
},
"publishExclude": [
"node_modules",
"bower_components",
"**.xproj",
"**.user",
"**.vspscc"
],
"exclude": [
"public",
"node_modules",
"bower_components"
]
}
package.json
:
{
"version": "1.0.0",
"name": "ASP.NET",
"private": true,
"devDependencies": {
"angular2": "2.0.0-alpha.36",
"gulp": "3.9.0"
}
}
"To use ASP.NET 5 beta7 with Visual Studio 2015, you will need to download and install the beta7 version (14.0.60831.0) of ASP.NET and Web Tools 2015."
这是 beta5
和一些使用 beta7
。匹配这些解决了这个问题,但是现在当我尝试 运行 IIS Express 中的项目时出现此错误:
Could not load file or assembly 'Microsoft.Dnx.Host.Clr' or one of its dependencies.
我认为问题仍然与版本相关——就像之前的 web.config
程序集参考问题一样——但我还不知道如何处理它。我尝试根据在 GitHub 上发现的类似问题修改 global.json
,但现在它无法构建。我猜它似乎找不到更新版本的 CLR。来自 VS2015 中的错误列表:
The dependency Microsoft.AspNet.Mvc >= 6.0.0-beta7 could not be resolved.
The dependency Microsoft.AspNet.Server.IIS >= 1.0.0-beta7 could not be resolved.
The dependency Microsoft.AspNet.Server.WebListener >= 1.0.0-beta7 could not be resolved.
global.json
:
{
"projects": [ "src", "test" ],
"sdk": {
"version": "1.0.0-beta7",
"runtime": "clr",
"architecture": "x86"
}
}
我的项目的引用树有黄色错误指示器,但在 NuGet 包管理器中查找我的项目没有显示任何升级(或据我所知根本没有安装任何东西)。
dnvm list
:
1.0.0-beta5 clr x64
1.0.0-beta5 clr x86
1.0.0-beta5 coreclr x64
1.0.0-beta5 coreclr x86
* 1.0.0-beta7 clr x86 default
1.0.0-beta8-15585 clr x86
dnu list
:
Microsoft .NET Development Utility CLR-x86-1.0.0-beta7-15532
我已经重新启动 VS,但没有帮助。在我的 global.json
中改回 beta5
使其成功编译,但随后出现 IIS 错误。
project.json
:
{
"webroot": "public",
"version": "1.0.0-*",
"dependencies": {
"Microsoft.AspNet.Mvc": "6.0.0-beta7",
"Microsoft.AspNet.Server.IIS": "1.0.0-beta7",
"Microsoft.AspNet.Server.WebListener": "1.0.0-beta7"
},
"commands": {
"web": "Microsoft.AspNet.Hosting --config hosting.ini"
},
"frameworks": {
"dnx451": { },
"dnxcore50": { }
},
"publishExclude": [
"node_modules",
"bower_components",
"**.xproj",
"**.user",
"**.vspscc"
],
"exclude": [
"public",
"node_modules",
"bower_components"
]
}
package.json
:
{
"version": "1.0.0",
"name": "ASP.NET",
"private": true,
"devDependencies": {
"angular2": "2.0.0-alpha.36",
"gulp": "3.9.0"
}
}
"To use ASP.NET 5 beta7 with Visual Studio 2015, you will need to download and install the beta7 version (14.0.60831.0) of ASP.NET and Web Tools 2015."