For anyone in the future wondering this, the correct answer is to use the local feed. My problem was that I had cached nuget packages which were being resolved during dotnet restore
.
The following command before restore solved my issues:
dotnet nuget locals all --clear
dotnet restore
Essentially, you need to have a nuget
config (NuGet.config) in your solution that sets up your local packages directory:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<clear />
<add key="LocalDev" value="./my-project/artifacts" />
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
</packageSources>
</configuration>
Where artifacts/ directory contains all of the .nupkg
packages you want to use during restore. It is obviously also essential that you must make sure those packages are built/compiled before you dotnet restore
in your primary solution:
dotnet pack /p:Version=5.22.12 --configuration Release --force --output "%~dp0artifacts";