VS2010 web deploy the connection string argument cannot be null or empty

MPD picture MPD · Jul 20, 2012 · Viewed 14.7k times · Source

Having problems deploying a website to an windows 2008 r2 server running IIS7. I have previously deployed another site to this server. The web deploy is connecting and copying my files to server but I see the following error(s).

1 The 'Connection String' argument cannot be null or empty
2   Web deployment task failed.((20/07/2012 14:19:16) An error occurred when the request was processed on the remote computer.)

(20/07/2012 14:19:16) An error occurred when the request was processed on the remote computer. Could not find a part of the path 'C:\Users\Me\Documents\Visual Studio 2010\Projects\MySite\MySiteClient\obj\Release\AutoScripts\EFDbContext-Deployment_SchemaOnly.sql'.     0   0   MySiteClient

I have verified that the path exists on my local machine.

I have tried publish with out web.config transforms and with using the xdt:transform functions to set the remote server strings.

I have also explicitly set the connection strings for both destination and source database in the Package/Publish SQL tab and am at a loss as to what the problem is.

Any ideas?

Answer

Leniel Maccaferri picture Leniel Maccaferri · Jun 3, 2013

This was happening right now to me and I managed to isolate the problem... after manually adding a new SQL Server connection string in my Web.config I started experiencing this very error when trying to deploy to the remote server.

When I opened the web deploy Publish profile in Visual Studio 2012 I noticed under the Settings tab that it had set this option: Use this connection string at runtime (update destination Web.config).

Strangely this was setup automatically by VS 2012...

To solve the problem, just uncheck that checkbox and web deploy should start working again.

enter image description here