Tag Archives: debugging

Visual Studio 2015 and LocalDB instance for LightSwitch


With Visual Studio 2015 RTM the database tooling has changed. How LightSwitch uses LocalDB has changed too. Remember the issue with VS2013 and LightSwitch SQL Server Project references being blank? Let us take a look and see what changed in this area and determine if LightSwitch and SQL Database Projects work better together.


How and why have things changed with LocalDB? I will refer to this Microsoft Connect feedback from 2014:

SQL Server 2014 Express LocalDB does not create automatic instance v12.0

In SQL14, we moved away from the numbering/versioning for the automatic instance and named itMSSQLLocalDBinstead of “v12.0”. The name of the automatic instance in the SQL14 documentation for LocalDB at http://msdn.microsoft.com/en-us/library/hh510202(v=sql.120).aspx has been fixed. If you require an instance to be named “v12.0”, you can create a named instance with that name.
Thanks & Regards, Pooja Harjani, Sr. Program Manager, SQL Server, Microsoft.”

A SQL 2014’s Local DB sample connection string looks like this:

Data Source=(localdb)\MSSQLLocalDB;AttachDbFilename=|DataDirectory|\mydb.mdf;Initial Catalog=mydb;Integrated Security=True;MultipleActiveResultSets=True

How this surfaces in LightSwitch

So, the name for the automatic instance is MSSQLLocalDB. This is the instance that LightSwitch in Visual Studio 2015 now uses to create intrinsic databases for projects.

Here is a screenshot of the SQL Server Object Explorer window in VS2015 showing two intrinsic databases underlying LightSwitch projects:

LightSwitch LocalDB use in Visual Studio 2015

LightSwitch LocalDB use in Visual Studio 2015

The ‘UserVoice‘ test project was created using VS2015 RC and is uppercase. The LightSwitch test project ‘ResearchDatabaseApp‘ was created using VS2015 RTM. This is where we can find our development time intrinsic databases.

Refer to SQL Server Data Tools RTM update for July 2015 blog post for final details with respect to Visual Studio 2015 RTM.

LightSwitch and SQL Database Projects

Next, I created a new SQL Database Project called ‘ResearchDatabase‘ in the same solution as the LightSwitch ‘ResearchDatabaseApp‘ project. Here is a screenshot showing the default target platform as SQL Server 2014.


Then moving to the LightSwitch project properties straight away we see:

LightSwitch SQL Database Project reference working in Visual Studio 2015

LightSwitch SQL Database Project reference working in Visual Studio 2015

The new project shows up immediately in the LightSwitch project properties. You can write scripts to manage the intrinsic database whenever you build or deploy the LightSwitch application. With post-deployment scripts, you can populate data, enhance the schema or add an index. Refer to the MSDN LightSwitch documentation for details: Managing the Intrinsic Database for LightSwitch.


So with Visual Studio 2015 and new LightSwitch projects the linking to SQL Database Projects is back working as it should! Another sign of continuing maintenance support for LightSwitch.


Debugging Data Bindings in XAML with Silverlight 4

[Last updated: 2011-05-24]
Yes, you read it correctly, Silverlight 4.
How can I do that?

Simply install the VS2010 SP1 and Silverlight 5 Beta and you get the unexpected bonus of the XAML Parser supporting debugging your data bindings for your Silverlight 4 projects. As SL5 sits nicely in VS2010 SP1 with SL4 it is worth installing the beta just for this feature.

Debugging XAML Binding in Silverlight 4

Debugging XAML Binding in Silverlight 4 - bonus!

I was at the @SLUGUK meeting 18th May 2011, and as Mike Taulty pointed out for other ‘features’, it is difficult to know whether such things as this were introduced by the service pack or the beta as nobody seems to have stopped to check in the rush to get the SL5 beta working 🙂

Checked against the NoDo Windows Phone 7 projects and it does not work, you can set a breakpoint but it cannot resolve the symbols. The new feature automatically creates the symbol names for you. I am optimistic that this feature will work with the Mango tooling to be released by end of May 2011 (that’s next week) [UPDATE: Mango beta no Xaml debugging for now].

No point in re-documenting the feature so:

Mike Taulty’s Blog: Silverlight 5 Beta Rough Notes – Debugging Data-Binding

Code Project: Debugging Data Bindings in XAML with SIlverlight 5 Beta

Further things to do and resources 
This article shows a nice side-effect encountered for Silverlight 5 projects after installing the Silverlight 5 Beta. Whether it is intended or here to stay we will have to wait and see but it has already proved to be a fantastic ROI.
Any comments or request for future topics are welcome.