是否可以选择将NuGet包恢复为repositoryPath
中定义的确切路径,忽略任何包ID?
在Visual Studio 2017 \ 2015中进行还原时,我得到路径.. \ Bin \ PackageID。 我希望文件恢复到.. \ bin。
我的软件包里面没有文件夹,只包含文件。
我的Nuget.config
<configuration>
<config>
<add key="repositoryPath" value="../Bin" />
</config>
</configuration>
我的PackageCode
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2012/06/nuspec.xsd">
<metadata>
<id>Bint</id>
<version>1.0.0</version>
<title></title>
<authors>admin</authors>
<owners>admin</owners>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>My package description.</description>
<dependencies>
<group targetFramework=".NETFramework2.0" />
<group targetFramework=".NETFramework3.5" />
<group targetFramework=".NETFramework4.0" />
<group targetFramework=".NETFramework4.5" />
<group targetFramework=".NETPortable0.0-Profile259" />
<group targetFramework=".NETPortable0.0-Profile328" />
<group targetFramework=".NETStandard1.0" />
<group targetFramework=".NETStandard1.3" />
<group targetFramework=".NETStandard2.0" />
</dependencies>
</metadata>
</package>
我将不胜感激。
答案 0 :(得分:0)
您可能使用PackageReference
,这意味着您无法使用repositoryPath
。
repositoryPath
仅适用于使用packages.config
的项目。
我希望将文件恢复到.. \ bin \
您可以使用RestorePackagesPath
属性指定还原包文件夹,但保存PackageIdentity
的文件夹结构。我认为改变这种行为是不可能的,无论如何关于这个的文档我都没有看到。
用户包文件夹的路径。所有下载的包都是 在这里提取。相当于
--packages
中的dotnet restore
。