nuget.config如何指定nuget软件包依赖项版本
我正在尝试制作一个Visual Studio 2019项目,该项目将自动下载Nuget软件包的特定版本,如果新用户打开该项目,它将自动恢复/下载该版本的软件包。
我正在尝试使用nuget.config文件在我的VS2019仓库的基础上进行填写,我的nuget.config包含一个源(文物),
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<config>
<clear />
<add key="repositoryPath" value="packages" />
</config>
<packageSources>
<!-- When <clear /> is present, previously defined sources are ignored -->
<!-- Remove this tag or un-comment the nuget.org source below to restore packages from nuget.org -->
<!-- For more info, see https://docs.nuget.org/consume/nuget-config-file -->
<clear />
<add key="Artifactory" value="https://my-artifactory-url/artifactory/api/nuget/ult-testware-nuget" />
</packageSources>
<packageRestore>
<add key="enabled" value="True" />
<add key="automatic" value="True" />
</packageRestore>
<activePackageSource>
<add key="All" value="(Aggregate source)" />
</activePackageSource>
</configuration>
但是哪些语法是什么是指定需要下载版本1.0的部分。包含“ martintestpkgxyz”的4个?我可以将其包含在我的nuget.config文件中,以便打开或构建时的软件包和版本会下载吗?
I am trying to make a Visual Studio 2019 project which will automatically download a specific version of a NuGet package, and if a new user opens that project, it will automatically restore/download that version of the package.
I'm trying to acomplish this using a nuget.config file at the base of my VS2019 repo, my nuget.config includes one source (Artifactory),
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<config>
<clear />
<add key="repositoryPath" value="packages" />
</config>
<packageSources>
<!-- When <clear /> is present, previously defined sources are ignored -->
<!-- Remove this tag or un-comment the nuget.org source below to restore packages from nuget.org -->
<!-- For more info, see https://docs.nuget.org/consume/nuget-config-file -->
<clear />
<add key="Artifactory" value="https://my-artifactory-url/artifactory/api/nuget/ult-testware-nuget" />
</packageSources>
<packageRestore>
<add key="enabled" value="True" />
<add key="automatic" value="True" />
</packageRestore>
<activePackageSource>
<add key="All" value="(Aggregate source)" />
</activePackageSource>
</configuration>
But what is the syntax to include a section that specifies the need to download version 1.0.0 of the package "MartinTestPkgXYZ" ? Can I include that in my nuget.config file so the package and version get downloaded when you open or build?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论