Microsoft LightSwitch 2012 - Update DataSource Error RRS feed

  • Question

  • I have a functional Visual Studio LightSwitch 2012 project using a SQL Server DataBase as its DataSource.  I recently added a few tables to the SQL Server DB and updated the DataSource in the LightSwitch Project.  I see the new tables in the DataSource Section of the Project 'Logical View'. I then run the application in debug mode and get no data displayed with a red 'x'.

    I have run the application both BEFORE updating the datasource and AFTER, and generated trace logs (using 'VERBOSE').  I have zipped these files and would like to be able to attach them.  I don't see a way to do that.  Does anyone know if it's possible to attach files?

    I am using the asp users and roles tables in my LightSwitch application.  I see entries in the log for the run that was successful (BEFORE updating datasource) where the various 'CanRead', 'CanInsert', 'CanUpdate', and 'CanDelete' methods are invoked for my tables, followed by information about me and the security setup for my login.  After that, I see information about the queries that are executed including the # of records returned.

    I don't see any entries in the log for the run that was unsuccessful (AFTER updating datasource) that reference the methods listed above, any checks about my login, or information about any queries being executed.

    Is it possible that updating the datasource messed up something with the permissions I setup?

    (The asp users and roles tables are now in my SQL Server Database because when I previously published a version of the application, I saved these tables to the SQL Server Database.  I'm importing ALL tables (including these) when I Update the DataSource.

    Thanks for any assistance anyone can give me.  I'd love to attach the zipped log files if I could figure out how.



    Wednesday, May 22, 2013 9:50 PM


  • Hi Sharon,

    Just to make sure I understand, let's call the SQL Server Database you mentioned Database A. Did you:

    • Create a LightSwitch application with authentication.
    • Attach to Database A into Data Source A and create Screens, etc.
    • Publish the application, and specify the same Database A to be used to store LightSwitch's users / roles tables.
    • Add some new tables to Database A.
    • Update Data Source A, adding the new tables and LightSwitch's users / roles tables.

    If so, I believe LightSwitch's users and roles tables are not supposed to be attached to like normal tables. Can you Update Data Source again, this time remove the users and roles tables, and try again?

    Another good way to see what went wrong is to turn off 'Just my code', enable break when an exception is thrown, then debug your application and see what exceptions are thrown.

    I don't think there's a way to attach files, but you can share your files to skydrive.com or other cloud storage and post the link here.

    Best regards,

    • Marked as answer by Angie Xu Thursday, June 6, 2013 12:19 AM
    Thursday, May 30, 2013 5:12 AM