TeamCity is changing the hintpath attribute for certain nuget packages in my csproj files. Because of this it is restoring the wrong version for the specific nuget package and I am getting build errors on the CI server. Everything works fine otherwise, even if I pull the repo myself and rebuild and restore.
Here is what I have in git:
<Reference Include="SimpleInjector, Version=3.2.3.0, Culture=neutral, PublicKeyToken=984cb50dea722e99, processorArchitecture=MSIL">
<HintPath>..\packages\SimpleInjector.3.2.3\lib\net45\SimpleInjector.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="SimpleInjector.Packaging, Version=3.2.3.0, Culture=neutral, PublicKeyToken=984cb50dea722e99, processorArchitecture=MSIL">
<HintPath>..\packages\SimpleInjector.Packaging.3.2.3\lib\net40-client\SimpleInjector.Packaging.dll</HintPath>
<Private>True</Private>
</Reference>
And here is what it says in TeamCity:
<Reference Include="SimpleInjector">
<HintPath>..\packages\SimpleInjector.3.2.7\lib\net45\SimpleInjector.dll</HintPath>
</Reference>
<Reference Include="SimpleInjector.Packaging">
<HintPath>..\packages\SimpleInjector.Packaging.3.2.7\lib\net40-client\SimpleInjector.Packaging.dll</HintPath>
</Reference>
I have no idea why this happens or how to prevent it. Anyone have experience with this issue or know of a project setting I can change to prevent it?