【发布时间】:2015-12-23 00:34:32
【问题描述】:
我正在编写一个基于 DNX 的可移植类库,我想在所有平台上使用它。这是它的project.json:
{
"title": "flavor.net",
"dependencies": {
"Be.IO": "1.0.0"
},
"frameworks": {
".NETPortable,Version=v4.5,Profile=Profile259": {
"frameworkAssemblies": {
"System.Collections": { "type": "build" },
"System.IO": { "type": "build" },
"System.Linq": { "type": "build" },
"System.Runtime": { "type": "build" }
}
}
}
}
这是单元测试的project.json(我正在使用xUnit.net 测试框架):
{
"dependencies": {
"flavor.net": "",
"VideoLibrary": "1.3.3",
"xunit": "2.1.0",
"xunit.runner.dnx": "2.1.0-rc1-build204"
},
"commands": {
"test": "xunit.runner.dnx"
},
"frameworks": {
"dnx451": { },
"dnxcore50": { }
}
}
当我尝试构建它时,我收到了几个错误,比如第一个文件中的所有 System 依赖项的 The dependency fx/System.Collections could not be resolved。奇怪的是,该项目本身似乎构建良好,但导致错误的是单元测试项目。
为了更清楚,这里有一个截图:
为什么会发生这种情况,我可以做些什么来解决它?我正在使用 VS 2015 Update 1,我的 DNX 版本是 1.0.0-rc1-update1。
【问题讨论】:
标签: c# asp.net .net asp.net-core dnx