dotnet restore指定私有源

提出问题

为了信息安全和不给自己惹上麻烦,给公司开发的nuget包最好发布到公司内部nuget服务上,如何在使用jenkins持续构建时指定nuget源呢?

解决问题

项目跟文件加增加nuget.config文件

<?xml version="1.0" encoding="utf-8"?>
<configuration>
	<packageSources>
		<add key="NuGet official package source" value="https://api.nuget.org/v3/index.json" />
		<add key="MyRepo - ES" value="http://localhost:18103/v3/index.json" />
	</packageSources>
</configuration>

参考

包源映射
nuget.config规则

posted @ 2022-09-01 14:40  东百牧码人  阅读(206)  评论(0)    收藏  举报