web.config transform - delete comments from connectionstring section

后端 未结 4 2178

I store several different connection strings in my web.config for development and testing. All but one is commented out so I can change info as needed.

When I publish, I

4条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-02-12 10:42

    What I did based on this answer was the following:

    • Removed the existing connectStrings section in Web.config which contains commented out connection strings used during debug time;
    • Re-added the connectionStrings section with the correct connection string to be used when the app is deployed.

    So in your Web.config transform file you have something like this:

    
        
    
    
    
    
    
    
    
    
    

提交回复
热议问题