I have a .Net48 solution and I use AutoMapper 10.1.1 in a project. AutoMapper 10.1.1 is the last update that supports .Net48.
I have created a Directory.Build.props file in the solution directory containing the following code with the hope that Nuget Package Manager will no longer request that I update the package:
<Project>
<ItemGroup>
<PackageReference Update="AutoMapper" Version="10.1.1" />
</ItemGroup>
</Project>
Sadly, however, this does not seem to be working. Am I missing something in this file?
I’ve tried other suggested approaches but this seemed to be the cleanest.
If you hope that Nuget Package Manager will no longer request that I update the package, please add the following to your project file:
<ItemGroup>
<PackageReference Include="AutoMapper" Version="[10.1.1]"/>
</ItemGroup>
Besides, if you use packages.config file, you can set allowedVersions
constraint.
<package id="AutoMapper" version="10.1.1" allowedVersions="[10.1.1]" />
With the above in place the Manage Packages dialog will not show any updates for AutoMapper.
For more information, please read docs:
Package versioning
Constraints on upgrade versions
2