none
Lightswitch not updating the Connection String for deployed application

    Question

  • Hello All,

        I am facing issues with my application deployment lately.

    I've mentioned the related issues in following 2 threads

    http://social.msdn.microsoft.com/Forums/en-US/lightswitch/thread/44d9745d-9a84-4a95-8ec9-2d1676666702

    http://social.msdn.microsoft.com/Forums/en-US/lightswitch/thread/760060c5-f53e-47b4-b5d9-ab2477d85075

    I've been trying to figure out whats wrong the entire day.

    & this is what I found strange. Once the application has been deployed (Deployed as desktop app hosted in IIS site named "IlluminousDevFresh")

    When I open the web.config file available @ C:\inetpub\wwwroot\IlluminousDevFresh

    I notice that the connection string my app is targeting is 

     

     

    <connectionStrings>
        <add name="_IntrinsicData" connectionString="Data Source=5.40.194.227\SQLEXPRESS;Initial Catalog=Illuminous_v1.0;Integrated Security=False;Persist Security Info=True;User ID=kreyon;Password=****;Pooling=True;Connect Timeout=30;User Instance=False" />
        <add name="DevExpress.XtraReports.LightSwitch.Server.XtraReportsService" connectionString="" />
      </connectionStrings>
    

     


    Where as the connection string that I used during publish is 

     

    Data Source=supreet-pc\sqlserver2008r2;Initial Catalog=Illuminous;Persist Security Info=True;User ID=tsupreet;Password=****;Pooling=True;Connect Timeout=30;User Instance=False
    

     


    If I am correct the published app should be pointing to this new connection?

    Can some one please throw some light on why the connection did not update even after a successful publish? & what needs to be done to fix the issue.

    Thanks & Regards

     

     


    Supreet
    • Edited by Supreet tare Saturday, November 26, 2011 5:35 AM modified string
    Friday, November 25, 2011 3:54 PM

Answers

  • We got it working finally.

    As one of our colleague found out the issue was pretty simple.

    All these Publish Configuration details are saved in a file <ProjectName>.lsproj.user

    Since we were using TFS somehow this file became read only & thus Lightswitch was not able to pick up the updated details from this .lsproj.user file & was using previous configuration it knew about.

    As a result my connection string was not being updated in final web.config file.

    All we have to do to solve the issue is to right click on the .lsproj.user file -> Properties-> Uncheck Read Only Check Box.

    This did the trick :)

    Thanks Akhil & Atul from our team to find out the answer :)

    Regards

    Supreet


    Supreet
    • Marked as answer by Supreet tare Monday, November 28, 2011 1:04 PM
    Monday, November 28, 2011 1:04 PM

All replies

  • Friday, November 25, 2011 4:03 PM
  • Thanks for pointing out Michael :)

    Any idea about the issue? Did you ever face something like that?

    Regards

    Supreet


    Supreet
    Saturday, November 26, 2011 5:36 AM
  • Thanks for pointing out Michael :)

    Any idea about the issue? Did you ever face something like that?

    Regards

    Supreet


    Supreet

    Sorry no, in my experience the Publish wizard sets the connection string properly.

    Make Them Ask: That's a LightSwitch App?

    http://LightSwitchHelpWebsite.com

    Saturday, November 26, 2011 5:40 AM
  • Ok but please confirm if I am correct when I say that only last successful publish details are shown in the publish wizard when you open it the next time. Correct? 

    & when we create a completely new LS app the wizard will all be empty. Cuz id does not have any previous publish configurations available.

    Am i correct there. This will help me identifying the exact location from where the wizard is fetching the publish configuration details.

    Regards

    Supreet

     


    Supreet
    Saturday, November 26, 2011 5:43 AM
  • Ok but please confirm if I am correct when I say that only last successful publish details are shown in the publish wizard when you open it the next time. Correct?  


    Supreet

    It appears that way to me too, but I admit that I may be drawing a conclusion that is not correct.

    Hopefully someone more knowledgeable as to exactly how things are set will weigh in :)


    Make Them Ask: That's a LightSwitch App?

    http://LightSwitchHelpWebsite.com

    Saturday, November 26, 2011 1:40 PM
  • I would tell exactly what Michael said, since it always worked for me but... not clear to me how you discovered that the target connection is bad. Did you check the Web.config file to fix the issue?


    Alessandro Del Sole
    Microsoft MVP - Visual Basic: development
    http://community.visual-basic.it/alessandro/
    Sunday, November 27, 2011 10:21 PM
  • Thanks Michael & Alessandro for trying to help.

     

    Yes I did check the connection strings in Web.Config. In fact the one posted above is from web.config file itself.

    Its kind of wiered that Lightswitch is completely ignoring the settings I am making during publish & using some old settings stored some where in or out of the scope of the application.

    I really hope some one from the team will be able to help.

     

    Thanks & Regards

     


    Supreet
    Monday, November 28, 2011 6:51 AM
  • its been almost 4 days now & no success :(

    Is this so difficult of an issue to be solved?

    Any pointers or any help is really appreciated :)

     

    Thanks & Regards

    Supreet


    Supreet
    Monday, November 28, 2011 11:22 AM
  • We got it working finally.

    As one of our colleague found out the issue was pretty simple.

    All these Publish Configuration details are saved in a file <ProjectName>.lsproj.user

    Since we were using TFS somehow this file became read only & thus Lightswitch was not able to pick up the updated details from this .lsproj.user file & was using previous configuration it knew about.

    As a result my connection string was not being updated in final web.config file.

    All we have to do to solve the issue is to right click on the .lsproj.user file -> Properties-> Uncheck Read Only Check Box.

    This did the trick :)

    Thanks Akhil & Atul from our team to find out the answer :)

    Regards

    Supreet


    Supreet
    • Marked as answer by Supreet tare Monday, November 28, 2011 1:04 PM
    Monday, November 28, 2011 1:04 PM
  • I'm so glad you got it sorted out. I think the lack of response was due to nobody else having experienced the same thing, & not actually knwoing what else to suggest.

    At least, thanks to you, we now know about this issue with that file & LightSwitch. Logical in hindsight, when you think about it, but not so obvious.

    Sucks being a trailblazer sometimes, doesn't it. :-)


    Yann - LightSwitch Central
     
    Click here for FREE Themes, Controls, Types and Commands
     
    If you found my post helpful, please click "Vote as Helpful"
    If I answered your question, please click "Mark as Answer"
     
    By doing this you'll help people find answers faster.
    Monday, November 28, 2011 3:05 PM
    Moderator
  • I have the same issue...

    Alexander Matos

    Monday, November 18, 2013 8:49 PM
  • Hi Alexander,

    This is a very old thread now, which was referring to LightSwitch 2011. Which version of LightSwitch are you using?

    Did the solution that Supreet posted not work for you?


    Yann Duran
         - Co-Author of Pro Visual Studio LightSwitch 2011
         - Author of the  LightSwitch Central Blog

    FREE Download: Luminous Tools for LightSwitch
    (a Visual Studio productivity extension for LightSwitch)
     
    Click Mark as Answer, if someone's reply answers your question
    Click  Vote as Helpful, if someone's reply is helpful
     
    By doing this you'll help everyone find answers faster.

    Monday, November 18, 2013 11:29 PM
    Moderator