【发布时间】:2016-05-18 14:40:02
【问题描述】:
目前,我收到以下错误:
Could not install package 'csharp-extensions 1.2.0'. You are trying to install this package into a project that targets '.NETFramework,Version=v4.6', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author.
这是我的仓库的链接:https://github.com/NullVoxPopuli/csharp-extensions
Nuget 链接:https://www.nuget.org/packages/csharp-extensions/1.2.0
在我的 project.json 中,我指定了 dnx46 和 dnxcore50
{
"version": "1.2.0",
"configurations": {
"Debug": {
"compilationOptions": {
"define": [ "DEBUG", "TRACE" ]
}
},
"Release": {
"compilationOptions": {
"define": [ "RELEASE", "TRACE" ],
"optimize": true
}
}
},
"dependencies": {
"Microsoft.Extensions.PlatformAbstractions": "1.0.0-*",
"System.Reflection": "4.1.0-*",
"xunit": "2.1.0-*",
"xunit.runner.dnx": "2.1.0-*"
},
"commands": {
"run": "csharp_extensions",
"test": "xunit.runner.dnx"
},
"frameworks": {
"dnx46": {
"dependencies": {
"System.Console": "4.0.0-beta-*",
"System.Reflection.TypeExtensions": "4.1.0-beta-*",
"System.Runtime.Extensions": "4.0.11-beta-*",
"System.Dynamic.Runtime": "4.0.11-beta-*",
"Microsoft.CSharp": "4.0.1-beta-*",
"System.IO": "4.0.11-beta-*"
}
},
"dnxcore50": {
"_": "this is the recommended windows runtime",
"dependencies": {
"System.Console": "4.0.0-beta-*",
"System.Reflection.TypeExtensions": "4.1.0-beta-*",
"System.Runtime.Extensions": "(4.0,]",
"System.Dynamic.Runtime": "(4.0.0,]",
"Microsoft.CSharp": "(4.0.0,]",
"System.IO": "(4.0,]"
}
}
},
}
我尝试将 nuget 安装到的项目是面向 .NET Framework 4.6 的类库(并且不是 dnx 项目)
更新:
【问题讨论】:
标签: c# .net nuget class-library dnx