locked
Visual Studio 2013 update 4 LightSwitch publish does not populate aspnet membership tables RRS feed

  • Question

  • I'm using an existing sql server database.  When I publish the application the schema is updated with the aspnet tables,  views and stored procedures but the tables are not populated.  Is there a work around to populate the tables so the Windows Authentication will work? 
    Saturday, March 21, 2015 10:26 PM

Answers

  • I found a solution to my issue.  This post explains a SQL script to add the Administrator role and user: A sql script for creating a LightSwitch user in the sql database

    I created the application record in the aspnet_Applications table first by executing aspnet_Applications_CreateApplication stored procedure passing in my application name.  

    I customized the script with my application name and user name.  Running the script populated all of the other required tables.

    This still didn't allow me to log into the published application.  Finally I looked at my iis server.  In the Authorization feature of the web site I opened the providers setting on Windows Authentication.  The top Provider was Negotiate.  I moved NTLM up to the top and now everything is working. 

    Wednesday, March 25, 2015 2:16 PM

All replies

  • Hi Craig,

    When you enable Windows or Forms authentication in a LightSwitch app, a set of SQL tables are used to store the user and role data. 

    We can also customize how and where LightSwitch gets the user and role data, we don’t have to use the default set of SQL tables that LightSwitch generates in its intrinsic database.  This post describes in detail how we can go about customizing the management of users and roles in your LightSwitch app.

    See:

    Customizing LightSwitch User Management

    Hope it helps.

    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 23, 2015 6:25 AM
  • Thank you, I will read that post.  It may help me fix my problem.  I have other LightSwitch applications published on the same server.  I never had an issue using the default set of SQL tables.  They have always been populated with the Application Name, Administrator Role, and the Admin User I entered in the Publish wizard.  Windows Authentication always worked before.  This no longer works.  The tables are created but no data is populated.  I don't need to customize the User Management.  The standard user management always worked before.
    Tuesday, March 24, 2015 12:07 AM
  •  Windows Authentication always worked before.  This no longer works.  The tables are created but no data is populated.  I don't need to customize the User Management.  The standard user management always worked before.

    I'm not sure why this happens, please clean and rebuild your current Project (Right-click > Clean, Right-click Rebuild respective) and see if that makes any difference at all.  

    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.

    Wednesday, March 25, 2015 9:12 AM
  • I found a solution to my issue.  This post explains a SQL script to add the Administrator role and user: A sql script for creating a LightSwitch user in the sql database

    I created the application record in the aspnet_Applications table first by executing aspnet_Applications_CreateApplication stored procedure passing in my application name.  

    I customized the script with my application name and user name.  Running the script populated all of the other required tables.

    This still didn't allow me to log into the published application.  Finally I looked at my iis server.  In the Authorization feature of the web site I opened the providers setting on Windows Authentication.  The top Provider was Negotiate.  I moved NTLM up to the top and now everything is working. 

    Wednesday, March 25, 2015 2:16 PM