我们想启动一个公司 nuget 包存储库.有没有办法通过命令行添加包源,以便我们可以通过设置或其他方式配置我们的新包源?
We want to start a company nuget package repository. Is there a way to add a package source through command line so we can configure our new package source through a setup or something?
我们基本上不想去
工具 - 选项 - 包管理器 - 包源 - 加号按钮 -添加名称和来源
Tools - Options - Package Manager - Package Sources - Plus button - add name and source
在公司的每台开发人员机器上.
on every developer machine in the company.
推荐答案包源存储在用户配置文件下的 NuGet.config 或 ProgramData 的系统范围内:
The package sources are stored in NuGet.config under the user's profile or system wide in ProgramData:
%AppData%\NuGet\NuGet.config %ProgramData%\NuGet\NuGetDefaults.config您可以使用类似于以下内容的命令行通过 NuGet 添加包源:
You can add package sources through NuGet using a command line similar to:
nuget sources add -name FeedName -Source YourFeed如果您在用户的配置文件下运行上面的命令将起作用.
The above command will work if you run it under the user's profile.
NuGet 2.7 在 ProgramData 中引入了系统范围的包源配置.因此,您可以使用安装程序将包源添加到 ProgramData 下的 NuGet.config 中.
NuGet 2.7 introduced system wide package source configuration in ProgramData. So you could add your package sources into NuGet.config under ProgramData with your installer.
更多推荐
添加 nuget 包源的脚本化方式
发布评论