How to Get a Stack Trace in LightSwitch

A lot of times LightSwitch customers will run into an error in the product and post a question on the forums but the LightSwitch development team needs more information about the error.  This blog post describes how you can help the LightSwitch development team determine the source of those kinds of errors you may encounter. …


Customizing LightSwitch User Management

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.  But did you know that you can customize how and where LightSwitch gets the user and role data?  You don’t have to use the default set of SQL tables that…


Using the SecurityData service in LightSwitch

In this blog post, I’m going to describe how LightSwitch developers can programmatically access the security data contained in a LightSwitch application.  Having access to this data is useful for any number of reasons.  For example, you can use this API to programmatically add new users to the application. This data is exposed in code…


LightSwitch Trick: Display Loading Message while a Screen is Loading

In the LightSwitch apps that I create, I have a common pattern where I display a “Loading” message in the title bar of a screen while it is loading and then set it to its actual screen name once it’s finished.  In particular, this is useful for screens whose title is dependent on the data…


Creating a Custom Login Page for a LightSwitch Application

When configuring a Visual Studio LightSwitch application to use Forms authentication, the application user is prompted with the following login UI when they open the application: Many LightSwitch customers have asked about creating their own custom UI in place of this default login experience.  Maybe you’d like to display the company logo, for example.  This…


LightSwitch Star Contest

Think you’ve got what it takes to be a LightSwitch star?  Check out the new LightSwitch application contest at


Visual Studio LightSwitch V1 is Released

Today is an exciting day.  After years of hard work, Visual Studio LightSwitch V1 has been released.  This is my first shipped product while working in the Server & Tools Division at Microsoft and I couldn’t be happier (my previous shipped products were in the Business Division).  Feedback from the first two beta versions has…


Query Reuse in Visual Studio LightSwitch

One of the features available in Visual Studio LightSwitch is to model queries that can be reused in other queries that you model.  This allows developers to write a potentially complex query once and be able to define other queries which reuse that logic.  In V1 of LightSwitch, this query reuse is exposed through the…


How to reference security entities in LightSwitch

In Visual Studio LightSwitch, there are a set of security entities defined by the runtime such as UserRegistration, Role, and Permission.  Numerous people have asked how they can create relationships to these entities.  These entities can’t be referenced within a developer’s application model.  They are only available programmatically.  There are potentially multiple solutions for working…


Filtering data based on current user in LightSwitch apps

In many applications, you need to filter data that is only relevant to the particular user that is logged in.  For example, a personal information manager application may only want users to view their own tasks and not the tasks of other users.  Here’s a walkthrough of how you can setup this kind of data…