Closed alasvant closed 6 years ago
Tested this also on another machine Visual Studio 2017 and SQL Server 2014 Express (with LocalDB). By default the sqllocaldb command is used from 2014 version so need to be in 2016 version binn folder as stated above workaround. Using the above and happy joy joy when hitting F5 or Ctrl + F5 ;)
it's great to have resource for resolutions, but not sure whether db issues should be part of the solution description. prerequisites - for sure.
Valdis, maybe you misunderstood me. What I mean add info about LocalDB version to requirements and then have known issues/workarounds for example on GitHub wiki page.
then of course old guy misunderstood you ;)
The default database file is created with SQL Server 2016 so to run this sample users need the SQL Server 2016 Express LocalDB installed (LocalDB is included only in the SQL Server 2016 Express with Advanced Services package). So this information would be nice to be included next to the npm version requirement. EDITED Clarification, enough to use Visual Studio 2017 as it contains a version of 2016 LocalDB but if you for example have installed a previous version of SQL Server 2014 Express for example then most likely the LocalDB version for MSSQLLocalDB is too old for the version used in music festival. If using VS2015 you might only have the default instance named v11.0 (not 100% sure about this).
In some cases users might have multiple SQL Server versions installed side by side and in some cases the LocalDB of SQL Server 2016 Express installation might have gotten 'broken' in away that depending which versions sqllocaldb.exe is used various errors might come ( see for example this: https://social.msdn.microsoft.com/Forums/sqlserver/en-US/1257bf26-6ab0-416d-bf26-34f128f42248/sql-2016-sp1-sqllocaldb-versions-errors-with-quotwindows-api-call-quotreggetvaluewquot?forum=sqlexpress ). Depending on what service pack you have installed you might have version number 13.0. or 13.1 (SP1) or 13.2 (SP2). In these cases most likely the default MSSQLLocalDB is created with previous version and when you try to run the music festival you will get error message something like this: "Cannot be opened because it is version 852. This server supports version 782 and earlier" (Your version numbers might be different).
Above link might help to get the tool to work but still there might be the fact that your MSSQLLocalDB is created with earlier version.
So to work around this without destroying your existing attached files to MSSQLLocalDB you could create a new SQL Server 2016 localDB instance and modify connection string value in connectionStrings.cs
To make sure you are creating a new SQL Server 2016 Express LocalDB do the following:
The above command will create a new instance called "MSSQLLocalDB16", there is no version given so your systems latest version is created and the '-s' tells to start it immediatly.
Next change the instance name in connectionStrings.cs from MSSQLLocalDB to MSSQLLocalDB16.
Hit Ctrl + F5 or F5 in Visual Studio and everything should now work.