please how do i change the connection string of a lightswitch application for debugging purposes . i have followed this post http://dougseven.com/2010/08/23/data-storage-in-visual-studio-lightswitch-2/
but i can seem to get it to work. anytime i change the web.config in the applicationroot/bin/debug when i run the application in debug mode the file gets recreated with the original value in the file.
i have no problem changing it when publishing the app.
and when i implement the change in the applicationdefinition.lsml file it has no effect
From Andy Kung lightswitch team:
If you attach to an external datasource, you can right click on that node in the Solution Explorer and select "Update Datasource" to modify the server info without recreating your screens.
EDITED
... but is not true.
You should change applicationroot/ServerGenerated/Web.config
instead applicationroot/bin/debug/web.config
.
Explanation:
If you turn to File View, in Data/ApplicationDefinition.lslm they are a reference to your connection string:
Then in project\ServerGenerated\Web.config
locate the connection string:
<connectionStrings>
<add name="_IntrinsicData" ... />
<add name="e8f0cfed-653d-42fc-9617-bcaee11eed91" connectionString="HERE!!!!!!
A little late but just in case... If you right-click the datasource then select "Update Datasource" then WAIT for the connection to fail (if the original server is not available) then hit 'Back' you be taken to the connection settings. Just update the connection settings and continue as normal.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With