我目前正在将一个类库项目从 DNX (RC1) 迁移到 dotnet cli (RC2)。此前,该项目引用了 .NET v4.5.1 框架库,project.json
文件如下所示:
"frameworks": {
"net451": {
"frameworkAssemblies": {
"System.Runtime": "4.0.10.0",
"System.Web": "4.0.0.0",
"System.DirectoryServices": "4.0.0.0",
"System.DirectoryServices.AccountManagement": "4.0.0.0",
"System.ServiceModel": "4.0.0.0",
"System.ServiceModel.Security": "4.0.0.0"
}
}
}
现在据我所知,(我可能错了)与 DNX 不同,新的 dotnet Cli 不支持 .NET 4.5.1,而是支持 .NET Standard。
所以问题是,.NET Standard 没有我想要的所有库。我必须更改什么才能引用 .NET 4.5.1 框架库?我阅读了有关导入声明的信息,但无法使其正常工作。这是我到目前为止(更新)的内容:
"frameworks": {
"net451": {
"frameworkAssemblies": {
"System.Runtime": "4.0.10.0",
"System.Web": "4.0.0.0",
"System.DirectoryServices": "4.0.0.0",
"System.DirectoryServices.AccountManagement": "4.0.0.0",
"System.ServiceModel": "4.0.0.0",
"System.ServiceModel.Security": "4.0.0.0"
}
},
"netstandard1.5": {
"imports": [ "dnxcore50", "portable-net451+win8" ]
}
}
我对我还需要做什么有点迷失......有什么想法吗?