Open
Description
NuGet Product(s) Involved
NuGet.exe, MSBuild.exe, dotnet.exe, NuGet SDK
The Elevator Pitch
packageSourceMapping
should be able to not only have a pattern but also version-limited matching. This would allow to look for local builds detectable by version in a local cache.
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSourceMapping>
<clear />
<packageSource key="Local package cache">
<package pattern="*" version="*-loc*" />
</packageSource>
<packageSource key="github-remote">
<package pattern="MyCompany.*" />
</packageSource>
<packageSource key="nuget-remote">
<package pattern="*" />
</packageSource>
</packageSourceMapping>
</configuration>
Additional Context and Details
Right now, to be able to use the local cache, you would need to add ALL patterns to the local cache for it to be checked as well as otherwise, it might not be the most specific one.
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSourceMapping>
<clear />
<packageSource key="Local package cache">
<package pattern="MyCompany.*" />
<package pattern="*" />
</packageSource>
<packageSource key="github-remote">
<package pattern="MyCompany.*" />
</packageSource>
<packageSource key="nuget-remote">
<package pattern="*" />
</packageSource>
</packageSourceMapping>
</configuration>
Resolving MyCompany.SomeLib
in version 1.0.0-loc20240307115400
should try to resolve it from the Local package cache
and github-remote
. Version 1.0.0
is enough to be checked on github-remote
.