Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to change the connectionstrings of a lightswitch application in debug mode

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

like image 808
Fabiyi Tunde Avatar asked Oct 22 '22 03:10

Fabiyi Tunde


2 Answers

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!!!!!!
like image 200
dani herrera Avatar answered Dec 15 '22 01:12

dani herrera


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.

like image 22
Alan Schofield Avatar answered Dec 14 '22 23:12

Alan Schofield