![](/img/trans.png)
[英]How to properly structure the dependencies of a netstandard1.0 NuGet package?
[英]Visual Studio Team Services Build Package Restore failing with project.json netstandard1.0 target
我最近使用project.json和新的netstandard1.0框架别名将我的可移植类库更新为目标.NET Core。 我的理解是Nuget 3.4现在支持此功能。 我的项目有以下project.json:
{
"supports": {},
"dependencies": {
"Microsoft.NETCore.Portable.Compatibility": "1.0.1",
"NETStandard.Library": "1.6.0"
},
"frameworks": {
"netstandard1.0": {}
}
}
这是从Visual Studio 2015 Update 3开始构建的。
但是,使用VSTS(是Visual Studio Online)版本时,在“程序包还原”步骤中现在给我以下错误:
The project 'MyProject' does not specify any target frameworks in 'C:\a\1\s\MyProject\project.json'.
它显示正在执行的命令是:
NuGet.exe restore "C:\a\1\s\Build.sln" -NonInteractive -configfile "C:\a\1\NuGet\newNuGet.config"
这是由于针对解决方案执行还原吗? 还是VSTS Build任务尚未使用Nuget 3.4?
您可以展开“高级”部分,然后选择最新版本的Nuget。 截至2016年10月,即为Nuget 3.5 rc2
我相信它已经得到解决,并且您使用的是NuGet的有效版本,但是您也可以在NuGet Installer之后添加命令行作为新的构建步骤,并调用dotnet restore
(工具: dotnet
,参数: restore
)。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.