In my solution I'm using Package.props file for settings versions for referenced packages.
For instance if I want to add a nuget package Microsoft.Cool.Package to one of my solution's projects, I just put in corresponding .csproj file a line:
<PackageReference Include="My.Cool.Package" />
And also add another one to Package.props:
<PackageReference Update="My.Cool.Package" Version="1.0.1" />
For local development I sometimes want to replace nuget package reference in all projects, like I want: <PackageReference Include="My.Cool.Package" /> to become <PackageReference Include="../../My.Cool.Package.csproj" />.
How can I achieve that just by making corresponding change in Package.props file, which will override all non local package includes.
If your .csproj has
then in Directory.Packages.props you can figure that out using
and based on that remove it and something else instead:
Note: due to msbuild evaluation order the lines must be in the order shown otherwise msbuild would first remove the package, then evaluate the property again and it would be false at that point.