SQL Server LocalDB instance fails to be created/started on Windows 10 build 1809

Viewed 357

We have a serious BUG reported by our clients, regarding the WPF desktop application, which is connecting to the SQL Server 2014 Express LocalDB.

At the startup of the app, the app failed connect to the local DB.
Seems that our (CNogaMedicalLocalDB)local DB instance failed to auto start. We manually got the local DB instance's info and we saw that the instance is in the "Stopped" state. Usually the instance is auto start and the state should be "Running" The local DB log didn't produced any valuable data. In case we start the local DB manually using CMD the app works fine.

The app works fine on Windows 7, 8 and 10 except the last WIN 10 build 1809 (which is our clients platform)! The app is being used heavily by many of our other clients around the world.

We cannot reproduce the issue in our Headquarters.
We tried to reproduce the issue on our QA platforms (Virtual Machines) running WIN-10 build 1809.

Apps Technical Details:

  1. WPF.
  2. EF Core version 7.0.0-rc1-final
  3. SQL Server 2014 Express LocalDB version 12.0.2000.8.
  4. Connection string: data source=(LocalDb)\InstanceLocalDB; Initial Catalog = MyAppDB; Integrated Security=True; MultipleActiveResultSets=True; Connection Timeout = 10

  5. The installation package is built with Advanced Installer version 12.3.1.

    5.1. The SQL Server 2014 Express LocalDB is installed together with app and contained as a prerequisite within the installation package.

    5.2. The SqlLocalDB Instance creation and starting is performed also during the application's installation via a custom action (PowerShell script which is runs at the final stage of the installation processes):

    SqlLocalDB.exe create "SqlLocalDBInstance" SqlLocalDB.exe start "SqlLocalDBInstance"

Thanks in advance.

Oleg Seider

R&D Department

CNOGA Medical Ltd.

Office: +972-4-6361080 ext.127

www.cnoga.com

1 Answers

According to a link posted by Nickolaj Anderson (who gives credit to a David Segura for getting to the root of this issue and wrote a blog post about it), this problem is caused by Windows 10 1809 lacking two dlls: BCP47Langs.dll and BCP47mrm.dll

The following PowerShell script is posted in the link (and here, just in case the link breaks!) to enable you to update your existing boot images that have already been reloaded from Windows ADK version 1809. It is advised that you make a backup before running the script, as I'm sure you would!

Instructions as given in Nickolaj's article:

  1. Make sure that you have access to a Windows 10 version 1809 64-bit ISO file and extract it’s content to a location in your site server.

  2. Create the required folders for exporting and mounting: C:\Temp\Mount\Source C:\Temp\Mount\Current C:\Temp\Export

  3. Copy the boot.wim file from the extracted location of Windows 10 version 1809 64-bit to the C:\Temp\Export folder.

  4. Update the $BootImagePath variable in the PowerShell script with the local path to the boot.wim / winpe.wim found in the data source of your boot image (remember to include the file name).

  5. Execute the script

Script:

# Variables
$SourceMountPath = "C:\Temp\Mount\Source" # Create this folder
$BootImageMountPath = "C:\Temp\Mount\Current" # Create this folder
$SourceExportFolder = "C:\Temp\Export" # Create this folder
$SourceBootPath = "C:\Temp\Export\boot.wim" # boot.wim file copied to this location from the Windows 10 1809 x64 source media
$BootImagePath = "" # Local path to your boot.wim / winpe.wim file (not boot.PACKAGEID.wim) for your boot image in ConfigMgr
# Export winpe.wim from boot.wim from Windows 10 1809 source files
$ExportImagePath = Join-Path -Path $SourceExportFolder -ChildPath "winpe.wim"
Export-WindowsImage -SourceImagePath $SourceBootPath -DestinationImagePath $ExportImagePath -SourceIndex 1
# Mount exported WinPE image
Mount-WindowsImage -ImagePath $ExportImagePath -Index 1 -Path $SourceMountPath
# Mount boot image
Mount-WindowsImage -ImagePath $BootImagePath -Index 1 -Path $BootImageMountPath
# Copy BCP47*.dll's
$SourceFilePath = Join-Path -Path $SourceMountPath -ChildPath "Windows\System32\*"
$BootImageFilePath = Join-Path -Path $BootImageMountPath -ChildPath "Windows\System32"
Copy-Item -Path $SourceFilePath -Destination $BootImageFilePath -Filter "BCP47*.dll" -Force
# Dismount exported WinPE image
Dismount-WindowsImage -Path $SourceMountPath -Discard
# Dismount boot image
Dismount-WindowsImage -Path $BootImageMountPath -Save

Hope this works for you!

Rachel

Related