Web Deployment Tool (MS Deploy)
Web Deploy / VS / Publish / Settings / Databases / Connection String...
Last post Sep 05, 2017 08:03 AM by Yuk Ding
Sep 04, 2017 08:45 PM|terry.clancy|LINK
I am using Web Deploy by way of Visual Studio / Build / Publish
I am NOT using Web Deploy and the VS Publish process to deploy my DataBase (I am doing that separately using Visual Studio Data Tools).
I AM trying to alter my 2 web.config database connection strings differently for each Publish Profile. I have tried to do this using:
Visual Studio / Build / Publish / Settings / Databases / ConnectionString DBName;Persist Security Info=True;
I have CHECKED the Checkbox "Use this connection string at runtime (update destination web.config)"
I have left UNCHECKED the Checkbox Update Database
However with these settings although the deployment otherwise works well, the connection strings are NOT updated in the destination web.config
I did get my site working using standard web.config Transforms based on Build Configuration (debug, release or custom). However I would prefer an approach that transforms Connection Strings based on Publish Profiles.
Any help to get this working would be appreciated.
Sep 05, 2017 08:03 AM|Yuk Ding|LINK
Do you want to override the existed connection string or you want to add another connection string? Maybe you could try to modify the connection string format like this:
Data Source=.\SQLExpress;Initial Catalog=aspnet-ContosoUniversity;Integrated Security=True
In addition, it is recommended to use the transform when you need to update the connection string for specific one.