locked
Multiple projects in VS2013 RRS feed

  • Question

  • Hi All,

    I would like to have 2 HTML clients that share the same data:

    1. a main system that requires authentication.

    2. a public facing system that has no authentication.

    How would this be achieved? Which of comparing the three options below would be appropriate?

    1. A single Intrinsic database shared by both clients

    2. The main system uses an intrinsic database, and the public one 'attaches' to that (if so, how?)

    3. Both client applications need to 'attach' to data, and skip the intrinsic db?

    Any information in regards to splitting projects, and sharing intrinsic databases would be appreciated. Thanks!

    Monday, October 28, 2013 11:46 PM

Answers

  • I would do #2 or #3. If #3, I would still use intrinsic db in the app that you want authentication so you can manage the security tables.

    Here is a nice blog about how to setup connection strings with observations and implications discussed:

    http://blog.pragmaswitch.com/?p=88

    Sharing the intrinsic db, while it could be done, may be problematic since the localdb needs to stay in sync with the published db.  Using the same file for localdb in 2 projects might lead to nasty results when publishing from one app and not the other.  By using an external connection to the published db in your other app, you'd a have lesser chance of a breaking change and you can get the changes on your time by doing an 'update datasource'. 

    There is another option which I've done by which you can enable authentication and still allows 'anonymous' users to access the app by logging them into a dummy account using logic on a custom login screen.  This was not fun, but prevented me from having to redo all my screen and maintain design changes in two apps.  Here is an old primer on replacing the OOB login screen for SL client.

    http://blogs.msdn.com/b/mthalman/archive/2011/12/08/creating-a-custom-login-page-for-a-lightswitch-application.aspx

    I haven't done this with HTML client, but I'd guess it might even be simpler. 

    As for breaking up a project or copying screens etc from one to another you could try this:

    http://xpert360.com/products/lightning_aide.aspx

    HTH,

    Josh

    • Marked as answer by Angie Xu Wednesday, November 6, 2013 6:14 AM
    Tuesday, October 29, 2013 5:05 PM

All replies

  • Hi Matt

    The answer depends a lot on your environment, have you considered using a LightSwitch Desktop Client to handle the authentication/admin side ?

    I don't think there's a short answer without more info unfortunately.

    Tuesday, October 29, 2013 10:56 AM
  • I would do #2 or #3. If #3, I would still use intrinsic db in the app that you want authentication so you can manage the security tables.

    Here is a nice blog about how to setup connection strings with observations and implications discussed:

    http://blog.pragmaswitch.com/?p=88

    Sharing the intrinsic db, while it could be done, may be problematic since the localdb needs to stay in sync with the published db.  Using the same file for localdb in 2 projects might lead to nasty results when publishing from one app and not the other.  By using an external connection to the published db in your other app, you'd a have lesser chance of a breaking change and you can get the changes on your time by doing an 'update datasource'. 

    There is another option which I've done by which you can enable authentication and still allows 'anonymous' users to access the app by logging them into a dummy account using logic on a custom login screen.  This was not fun, but prevented me from having to redo all my screen and maintain design changes in two apps.  Here is an old primer on replacing the OOB login screen for SL client.

    http://blogs.msdn.com/b/mthalman/archive/2011/12/08/creating-a-custom-login-page-for-a-lightswitch-application.aspx

    I haven't done this with HTML client, but I'd guess it might even be simpler. 

    As for breaking up a project or copying screens etc from one to another you could try this:

    http://xpert360.com/products/lightning_aide.aspx

    HTH,

    Josh

    • Marked as answer by Angie Xu Wednesday, November 6, 2013 6:14 AM
    Tuesday, October 29, 2013 5:05 PM
  • Here is a very interesting blog I ran across today:

    http://blog.ofanitguy.com/2013/10/08/how-to-create-an-expanded-lightswitch-2013-project/

    http://blog.ofanitguy.com/2013/10/13/lightswitch-2013-user-management-html-part-1/

    http://blog.ofanitguy.com/2013/10/13/lightswitch-2013-user-management-html-part-2/

    They have enabled admin of Users & Roles without needing the Silverlight Client. 

    Basically they have added, MVC and Web API so that... "we are able to create a full MVC website, Desktop SPA application and our LightSwitch Mobile app all within the same project and sharing code...One of the great features out of this is we can use Visual Studio LightSwitch to do all of our data management without having to go down into the Entity Framework."

    Also, by renaming the HTML Client project this might open the possibilities of having two HTML Clients in the same solution....perhaps one with forms auth and one without...both sharing the same intrinsic database.

    Something to try on a slow day maybe.

    HTH,

    Josh

    Thursday, November 7, 2013 6:34 PM