skip to content
Martijn Boland Blog

NuGet package restore with multiple repositories and file shares

/ 1 min read

To enable NuGet package restore from multiple repositories you have to edit the NuGet.targets file in the .nuget solution folder.

<ItemGroup Condition=" '$(PackageSources)' == '' ">
<!-- Package sources used to restore packages. By default, registered sources under %APPDATA%\NuGet\NuGet.Config will be used -->
<!-- The official NuGet package source ( will be excluded if package sources are specified and it does not appear in the list -->
<PackageSource Include="" />
<PackageSource Include="\\\\my-server\\my-packages\\" />

Important: escape the backslashes in the file share path, or you’ll get a very cryptic error message!