Nuget ~ Let the bags carry their own configuration information, nuget bags

Source: Internet
Author: User

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!

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.