Nuget ~ Let the bags carry their own configuration information, nuget bags
After developing components, we know that components have related configuration items. The most common practice is to write them to the web. config, and if you put this file in nuget for packaging, when installing the package, you will be prompted that this file already exists and cannot overwrite the original config file, we can only write the configuration information to another text file, and the user needs to manually copy the information to their own config file after installing the package, it is really helpless, no one is willing to do this repetitive job!
Solve this problem
Use the web. config. transform file to write your personal information in it. It will be automatically merged into the existing config file.
For example, Microsoft. AspNet. WebApi. Core also has this file
The content is as follows:
<?xml version="1.0" encoding="utf-8"?><configuration> <system.webServer>
After the VS api project is created, it will automatically download the package from the nuget server and merge the config file with the local file. It is indeed quite practical, they also completely said goodbye to our copy work!