New Site for my LightSwitch Tutorials and Tips…

We’re moving all our tutorials over to:

http://lightswitch.codewriting.tips

Few things to note about this new platform…

  • Its a LightSwitch application
  • Uses the lsWires framework
  • Allows anonymous visitors
  • Not hosted on Azure… meaning its FAST
  • Ability to change themes on the fly
  • Guests can sign up for Alerts
  • … and a ton of other internal features

21 thoughts on “New Site for my LightSwitch Tutorials and Tips…

  1. I really appreciate the work you have done and look forward for what’s coming.
    I have gone thru the tutorial and got it working, but when I try to implement the User Administration part on a production server I run into problems:
    Connecting to the SecurityData Data Source raises authentication errors.
    The connection string in web.config is ponting to the right service which can be verified by browsing directly to it. But it is not using the credentials of the current user.
    I have tried using the new ‘partial void formsSecurityData_SendingRequest(ODataSendingState state)’ with no success so far. But I suspect that I have overlooked something more basic?

    In other words: How to ensure that the OData connection to formsSecurityData is done using the logged in users security context?

    Any hints?

    • dwm9100b says:

      Jens, It should be transparent. Note that only users that have Security Administration permissions can access the security data. When you deploy your lightswitch app it asks if you want a security admin to be created. You can log in with that account and then add more role, users.

      Have you downloaded our lsWires Starter kit and see if it works as expected?

      • tigertop says:

        I am having the same error as Jen. When accessing formsSecurityData/Roles I get 401 Unauthorized, but when I access microsoft.LightSwitch.SecurityData.svc/Roles I get the list of Roles.

      • dwm9100b,
        It is on the deployed solution. During debug it’s not an issue as the Development account is also an administrator. But in a deployed solution with any number of different users having the security administration role, I would like to be sure that the OData DataSource connecting to the security data is done using the currently logged in user account.

        What I have done so far, as an alternative, is to code a ria based datasource doing the equvalent. In this I can control credentials. And I can also use only one external database for both data, security and roles.

        And yes, the IsWires starter kit Works for me – except for the issue above.
        /Jens

      • dwm9100b says:

        I see. Easily overcome by putting logic at the data source validating permissions before serving data. But since you’ve already created your work around I won’t go into detail.

        Happy Holidays!

    • dwm9100b says:

      I’m unclear what you mean regarding formsSecurityData. Are we talking after you’ve published the application or during development?

      I’ll send an email and we can work thru this that way via comments… I think it would be more productive.

      • iIntegrate says:

        Hi, first of all thanks for lswires, I downloaded lsWires Starter kit I am able to browse Roles and User while running (debugging) through VS 2013 i.e. all ok but I am having the same error as Jen after deployment When accessing formsSecurityData/Roles I get 401 Unauthorized however I am created administrator user during deployment and same is being used I am able to open all other screens except Roles & User, I have spent two days but not getting fix, please help

      • dwm9100b says:

        Sorry for your issues.

        When deploying, are you changing the connection string for the security database? It should be an HTTP string that is using the root of your application.

        http://www.mydomain.com/Microsoft.LightSwitch.SecurityData.svc

        You also need to add the admin credentials in the conx string.

      • dwm9100b says:

        Here is an example:

        “http://www.myAppsDomain.com/Microsoft.LightSwitch.SecurityData.svc;is windows authentication=False;allow invalid certificate=False;user name=AppAdmin;password=AppAdminPwd!$”

  2. tigertop says:

    Hi,
    We have encountered a bug in the lsWires.js’s initializeCloseCommand function, when using screens with “Show in Dialog” set to true. This function calls the shell.navigateBack(distance) method, where the distance variable is not defined. Where is distance variable supposed to be defined?

    We used the following temporary fix for this error: We substituted the calls to shell.navigateBack(distance) with the following code
    if (typeof distance !== “undefined”) { shell.navigateBack(distance); } else { shell.navigateBack(); }

    • dwm9100b says:

      Thanks for this catch. And yes its a bug. Distance is a parameter that gets passed in and taken from the original msls code base. I’ve made the fix and will be updating the Nuget and starter kit shortly. Along with new functionality.

      thanks again.

  3. tigertop says:

    Hi! Thanks for your awesome contribution. What are your plans regarding the metro menu in the new project ? Does the core LsWires support creation of navigation menus ?

    Thanks again!

  4. Ken says:

    Hi!

    I am very excited to get into your epic work! It looks like it has a lot of great stuff.

    I was following your tutorial with no problems until I tried to add LightSwitchWires from nuget. It fails and I get the following error:

    Install failed. Rolling back…
    Failed to add reference to ‘Newtonsoft.Json’.

    (see complete log below)

    How do I fix this to continue with the install tutorial?

    Many thanks for all your help.

    I am developing with VS2013 Update 4.

    ============ Full Log ===========================================
    Attempting to resolve dependency ‘Moment.js (≥ 2.8.2)’.
    Attempting to resolve dependency ‘lodash (≥ 2.4.1)’.
    Attempting to resolve dependency ‘Microsoft.AspNet.WebApi.OData (≥ 5.3.1)’.
    Attempting to resolve dependency ‘Microsoft.AspNet.WebApi.Client (≥ 5.2.2)’.
    Attempting to resolve dependency ‘Newtonsoft.Json (≥ 6.0.4)’.
    Attempting to resolve dependency ‘Microsoft.Net.Http (≥ 2.2.22)’.
    Attempting to resolve dependency ‘Microsoft.Bcl (≥ 1.1.9)’.
    Attempting to resolve dependency ‘Microsoft.Bcl.Build (≥ 1.0.14)’.
    Attempting to resolve dependency ‘Microsoft.AspNet.WebApi.Core (≥ 5.2.2 && < 5.3.0)'.
    Attempting to resolve dependency 'Microsoft.Data.OData (≥ 5.6.0)'.
    Attempting to resolve dependency 'System.Spatial (= 5.6.0)'.
    Attempting to resolve dependency 'Microsoft.Data.Edm (= 5.6.0)'.
    Attempting to resolve dependency 'Microsoft.AspNet.WebApi.WebHost (≥ 5.2.2)'.
    Installing 'Moment.js 2.8.2'.
    Successfully installed 'Moment.js 2.8.2'.
    Installing 'lodash 2.4.1'.
    Successfully installed 'lodash 2.4.1'.
    Installing 'Newtonsoft.Json 6.0.4'.
    Successfully installed 'Newtonsoft.Json 6.0.4'.
    Installing 'Microsoft.Bcl.Build 1.0.14'.
    Successfully installed 'Microsoft.Bcl.Build 1.0.14'.
    Installing 'Microsoft.Bcl 1.1.9'.
    Successfully installed 'Microsoft.Bcl 1.1.9'.
    Installing 'Microsoft.Net.Http 2.2.22'.
    Successfully installed 'Microsoft.Net.Http 2.2.22'.
    Installing 'Microsoft.AspNet.WebApi.Client 5.2.2'.
    Successfully installed 'Microsoft.AspNet.WebApi.Client 5.2.2'.
    Installing 'Microsoft.AspNet.WebApi.Core 5.2.2'.
    Successfully installed 'Microsoft.AspNet.WebApi.Core 5.2.2'.
    Installing 'System.Spatial 5.6.0'.
    Successfully installed 'System.Spatial 5.6.0'.
    Installing 'Microsoft.Data.Edm 5.6.0'.
    Successfully installed 'Microsoft.Data.Edm 5.6.0'.
    Installing 'Microsoft.Data.OData 5.6.0'.
    Successfully installed 'Microsoft.Data.OData 5.6.0'.
    Installing 'Microsoft.AspNet.WebApi.OData 5.3.1'.
    Successfully installed 'Microsoft.AspNet.WebApi.OData 5.3.1'.
    Installing 'Microsoft.AspNet.WebApi.WebHost 5.2.2'.
    Successfully installed 'Microsoft.AspNet.WebApi.WebHost 5.2.2'.
    Installing 'lsWires 1.0.1'.
    Successfully installed 'lsWires 1.0.1'.
    Adding 'Moment.js 2.8.2' to lsWireCore.App.
    Successfully added 'Moment.js 2.8.2' to lsWireCore.App.
    Adding 'lodash 2.4.1' to lsWireCore.App.
    Successfully added 'lodash 2.4.1' to lsWireCore.App.
    Adding 'Newtonsoft.Json 6.0.4' to lsWireCore.App.
    Uninstalling 'Newtonsoft.Json 6.0.4'.
    Successfully uninstalled 'Newtonsoft.Json 6.0.4'.
    Uninstalling 'lodash 2.4.1'.
    Successfully uninstalled 'lodash 2.4.1'.
    Uninstalling 'Moment.js 2.8.2'.
    Successfully uninstalled 'Moment.js 2.8.2'.
    Install failed. Rolling back…
    Failed to add reference to 'Newtonsoft.Json'.

    • dwm9100b says:

      Thanks for the notification Ken… I’ll look right into the issue and get a fix out.

      My apologies.

    • dwm9100b says:

      Was my bad… I thought I’d be smart and have the Web.API get added to the server automagically. Which caused this error. I’ve taken that out for now until I can get it scripted. Thanks again for bring this to my attention.

  5. Etienne says:

    Hi! Thanks for your contribution, I’m looking into your previous LsCoreProject since yesterday and now I found your LsWireCore. What’s your plan regarding these 2 projects? Will you merge them?

    • dwm9100b says:

      lsCoreProject will be archived eventually. The new framework is so much more robust. What I will be doing is using the new Core and from that create new projects with functionality of the old projects… make sense? So eventually I’ll have a project that includes the core but add in the Tiles.

      • Etienne says:

        Yeah makes sense! I’m playing around that actually and see what I can do by myself. I have a brand new project starting, first one on LS and I want to start it right. Thanks for your contribution and I hope to be able to contribute to your projects once I get more grasp around LS and the stuff you created. Thanks again!

  6. Simon Paul says:

    Great Stuff. Appreciate the love and work you put into LightSwitch!

  7. Joe says:

    If you target this to programmer, it might be more useful to share some insight on how you design and implement the framework rather than showing how to use your framework.

    • dwm9100b says:

      Appreciate the comment. It will be coming as part of the reference side.

      With that said, the code is heavily commented and anyone that’s interested in its implementation can easily follow the internals.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: