DLL version of package does not match what msbuild is looking for

In a github repo, I am building the project within and packing it as a nuget package in an action like so:
- name: Pack NuGet package
        run: dotnet pack TestEntities/TestEntities.csproj --configuration Release --output ./nupkg

and then I upload it as an artifact and make a release with it. Another repo downloads this nuget package file to use in its own build process.

The nupkg file produced is named TestEntities.1.0.0.nupkg. Inside of the lib\netstandard2.0\ folder is the dll, TestEntities.dll. The version of this dll is 2025.5.19.52. The nuspec file shows <version>1.0.0</version>.
Finally, in the csproj of the project that uses the package, it shows the following:

<Reference Include="TestEntities, Version=2025.5.19.52, Culture=neutral, processorArchitecture=MSIL">
   <HintPath>..\packages\TestEntities.1.0.0\lib\netstandard2.0\TestEntities.dll</HintPath>
</Reference>


It builds fine locally. However, in the msbuild step in the action I see the following error:
ResolveAssemblyReferences: Primary reference "TestEntities, Version=2025.5.19.52, Culture=neutral, processorArchitecture=MSIL".
C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(2434,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "TestEntities, Version=2025.5.19.52, Culture=neutral, processorArchitecture=MSIL". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. [C:\actions-runner\_work\test-repo\test-repo\TestApp\TestApp.csproj]
For SearchPath "{HintPathFromItem}". Considered "C:\actions-runner\_work\test-repo\test-repo\packages\TestEntities.1.0.0\lib\netstandard2.0\TestEntities.dll", but its name "TestEntities, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null" didn't match the expected name "TestEntities, Version=2025.5.19.52, Culture=neutral, processorArchitecture=MSIL".
Was this page helpful?