locked
[SOLVED] Lightswitch Desktop Deployment Issues RRS feed

  • Question

  • Hi, I'm trying to build a desktop application with LightSwitch 2012, using a networked sql server instance for the database and AD group for login/access permissions.  The AD group and database already exist and data in the database is accessible by those in the group.

    When another user runs the application through the setup.exe (which has been copied to the network after being published on my local machine), the application window opens up and then a dialog saying 'Error connecting to database.' appears.  When you click this the app background says an error has occurred and if it continues to contact the system administrator.

    Two questions:

    1) (If this is a common error) Does anyone know how what I've done wrong and how to fix it?

    if not

    2) (If this is something only I could stuff up) Where do I find some log info on what has gone wrong?  I have set all the Trace events in ServiceConfiguration.csfg to true (and Trace.Level to information), so where do I find that trace information?

    tia


    • Edited by nob0dy Friday, March 21, 2014 6:30 AM
    Friday, March 14, 2014 7:26 AM

Answers

  • OK, got it sorted.  It was one of two things, with what I think is most likely first:

    Because I had an already existing database, with already existing logins, and already existing AD groups, I figured I didn't need to 'Create Database Login' in the 'Database Connections' step of the publishing wizard (VS2012 version).  Somewhere around version 1.0.20.0 of the app, I decided to try and create a new login, just to see what would happen.

    In the 'Publish Output' section of the wizard, I had identified the publish directory with normal win/dos lettering (ie G:\NetworkDrive\Folder).  I changed this to follow unc format (\\servername\stuff\NetworkDrive\Folder).

    After doing these things (both in the same step, so I'm not 100% sure it was the new login), the app 'just worked'.  Thanks for the assist Nicolás.

    • Marked as answer by Angie Xu Friday, March 21, 2014 6:20 AM
    Friday, March 21, 2014 6:18 AM

All replies

  • This looks very much like this situation:  http://social.msdn.microsoft.com/Forums/vstudio/en-US/d7a401b2-eb84-46bf-91b3-67ac4bdd43af/deployment-woes?forum=lightswitch

    Some further info about my issue:

    I can build without enabling Access Control, and it runs fine on the other machine.

    Both the application data, and the _IntrinsicDatabase are on the same Sql Server database.  Hence, in the Publish Application Wizard, the user connection and administrator connection are the same.

    The install instructions (install.htm) say to install SqlServer express on the client.  Do I need to install that when the application is connecting to a networked SqlServer instance?

    The aspnet tables have been installed in that database - except my application data are in different schemas than the aspnet tables' schema of dbo.  Could this have something to do with anything?

    I have enabled tracing, but because the app doesn't really start, I can't see much.  I did locate this:

    1 17/03/2014 2:44:59 PM Services/Microsoft-LightSwitch-Security-ServerGenerated-Implementation-AuthenticationService.svc/binary/GetAuthenticationInfo 200 GET View Details
    2 17/03/2014 2:44:58 PM Web/Microsoft-LightSwitch-Security-ServerGenerated-Implementation-AuthenticationService.svc/binary/GetAuthenticationInfo 200 GET View Details
    3 17/03/2014 2:45:02 PM Microsoft.LightSwitch.Client;component/screens/screenpresentation/internalframework/resources/resources/x.png 404 GET View Details

    I'm really stuck here - any assistance is very appreciated.

    cheers


    • Edited by nob0dy Monday, March 17, 2014 7:54 AM
    Monday, March 17, 2014 7:53 AM
  • Hi tia

    Welcome to LightSwitch forum.

    According to your description above, I think we should look into this issue first.

    To publish a 2-tier desktop application, choose Desktop on the Application Type page of the Application Designer, and choose the Publish button to display the LightSwitch Publish Application Wizard.

    Once the application is published, users can install it from the publish location that you specify in the wizard by running the Setup.exe file.

    The publishing process is the same for both desktop and browser applications. To publish a 3-tier application, open the Client Designer, go to the Application Type page, and then choose either the Desktop or Web option button.

    Please refer to the guide to check your procedure first,

    Deploying LightSwitch Applications: http://msdn.microsoft.com/en-us/library/ff872288.aspx

    Moreover, we will also look into this issue, and check whether we can give precise troubleshooting.

    Best regards

    Angie


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Monday, March 17, 2014 12:26 PM
  • Hi Angie,

    > ... choose Desktop on the Application Type page of the Application Designer, and choose the Publish button ...

    > ...users can install it from the publish location that you specify in the wizard by running the Setup.exe file

    done, and done.  The only difference is I publish to my local c:\ drive and then copy the contents to a network drive that the users install from.  I will see if it makes a difference publishing straight to the network drive tomorrow (au time), but it feels to me like a db perms problem, rather than a location/directory structure issue.

    I have followed the VS2012 version of the guide you referenced, and its supplemental here:  http://msdn.microsoft.com/en-us/library/ff852056%28v=vs.110%29.aspx

    Monday, March 17, 2014 1:33 PM
  • OK, I have now published directly to the network folder and it makes no difference.  The same issue occurs when the user tries to install. 

    To help with diagnosis, here are the publish settings:

    Application Type:  Desktop

    Application Server Configuration:  Local

    Publish Output:  Publish directly to the database now

    Database connections: 

       User connection:  Data Source=lightning;Initial Catalog=DLGDB;Integrated Security=True

       Publish Database schema:  Checked

        Administrator connection:  Data Source=lightning;Initial Catalog=DLGDB;Integrated Security=True

    Authentication:  No, an application administrator already exists.  (The first time I published, I set this to Yes, create an application administrator and set it to my username)

    Prerequisites: No, only install the prerequisites

        Download from the internet

    Other connections: Data Source=lightning;Initial Catalog=DLGDB;Integrated Security=True

    Specify a certificate:  all blank

    Tuesday, March 18, 2014 4:03 AM
  • Hi,

    I think you can't enable tracing with a 2-tier local application server configuration, because it is related to IIS.

    You can check the Windows Event Viewer, it helped me in the past. One thing you should do is try connecting to the database from a client machine, opening SQL Server Management Studio, to check the credentials are OK. Also check the name of the Data Source, make sure you are not missing the instance, if applicable (ie lightning\sqlexpress).

    Last but not least, I had problems of my own with the Microsoft.Data.Services a few months ago, prior to migrating to VS2013. See how I solved them here.

    Tuesday, March 18, 2014 1:59 PM
  • OK, got it sorted.  It was one of two things, with what I think is most likely first:

    Because I had an already existing database, with already existing logins, and already existing AD groups, I figured I didn't need to 'Create Database Login' in the 'Database Connections' step of the publishing wizard (VS2012 version).  Somewhere around version 1.0.20.0 of the app, I decided to try and create a new login, just to see what would happen.

    In the 'Publish Output' section of the wizard, I had identified the publish directory with normal win/dos lettering (ie G:\NetworkDrive\Folder).  I changed this to follow unc format (\\servername\stuff\NetworkDrive\Folder).

    After doing these things (both in the same step, so I'm not 100% sure it was the new login), the app 'just worked'.  Thanks for the assist Nicolás.

    • Marked as answer by Angie Xu Friday, March 21, 2014 6:20 AM
    Friday, March 21, 2014 6:18 AM
  •  Thanks for the assist Nicolás.

    No problem, glad you solved it and welcome to the forum.
    Friday, March 21, 2014 1:50 PM