Skip to content
| Marketplace
Sign in
Visual Studio>Tools>Config Source Nupkg Mod Preserver
Config Source Nupkg Mod Preserver

Config Source Nupkg Mod Preserver

Henning Klokkeråsen

|
285 clicks
| (0) | Free
Prevents loss of config modifications done by NuGet packages on install/update/uninstall, when you have a config transform setup
Get Started

Prevents loss of config modifications done by NuGet packages on install/update/uninstall, when you have a config transform setup where the root config file (e.g. \web.config) is a result of transformation from a source config file (e.g. \Configurations\web.config).

This is done by merging any and all config files in each directory one level below the solution file back to the corresponding source config file, as defined in the directory's .wpp.targets file (the first if multiple are found).

Note that the source config file will also get the results of the transformations in the .debug.config file (or whichever configuration was last built), since the transformed config file will have those transformations in it as well as any modifications done by NuGet packages - so you must carefully which changes should be kept and which should be discarded in the source config file. TIP: Add an empty configuration ("Base") in Configuration Manager and build in that configuration to ensure the source and transformed config files are equal, thereby avoiding unwanted merging of local/debug values into the source config.

Prerequisites:

  • Supports Visual Studio 2017 only
  • git must be installed (and in PATH)
  • \Configurations\XYZ.config and \XYZ.config must be similar (have several runs of the same lines), in order for git to be able to perform the merge-file algorithm - which should be fine as the latter is a result of the former
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft