When using GeneratedBindingRedirectsAction with, say, the Overwrite option, this custom SDK will refresh the section after the project is built.
Needing to perform a build however makes the dependency upgrade process inherently incompatible with what dependabot does when creating NuGet update PRs, thus requiring extra manual steps to force the build and then append the web.config updates on top of the branch created by dependabot.
I did a quick investigation, and it appears that dependabot already performs a dotnet restore today as part of its process, which is useful for producing needed diffs on packages.lock.json files when using locked restore mode.
If this SDK could also tap into the same process as lock files do (run binding redirect updates on restore), it would naturally work with dependabot PRs and we would be able to merge those with zero manual intervention.
I wasn't sure whether or not it was possible to tap into the restore process from MSBuild, but it appears to be possible using BeforeTargets="Restore" and AfterTargets="Restore" as long as the project is leveraging SDK-style csproj.
Can this SDK be updated in such a way that it does the binding redirect regeneration step during restore instead of during build?
When using
GeneratedBindingRedirectsActionwith, say, theOverwriteoption, this custom SDK will refresh the section after the project is built.Needing to perform a build however makes the dependency upgrade process inherently incompatible with what
dependabotdoes when creating NuGet update PRs, thus requiring extra manual steps to force the build and then append theweb.configupdates on top of the branch created bydependabot.I did a quick investigation, and it appears that
dependabotalready performs adotnet restoretoday as part of its process, which is useful for producing needed diffs onpackages.lock.jsonfiles when using locked restore mode.If this SDK could also tap into the same process as lock files do (run binding redirect updates on
restore), it would naturally work withdependabotPRs and we would be able to merge those with zero manual intervention.I wasn't sure whether or not it was possible to tap into the
restoreprocess fromMSBuild, but it appears to be possible usingBeforeTargets="Restore"andAfterTargets="Restore"as long as the project is leveraging SDK-stylecsproj.Can this SDK be updated in such a way that it does the binding redirect regeneration step during
restoreinstead of duringbuild?