0

I recently installed Visual Studio IDE 2022 Version 17.6.2 and created a new Blazor Server Project targeting .NET 7.

For some reasons, unknown to me, the localdb is not listed under SQL Server on the SQL Server Explorer. I tried the following:

  1. Repair Visual Studio IDE.
  2. Check Registry for localdb instances.
  3. Checked the Visual Studio Installer and can see that SQL Server Express 2019 LocalDB is added and downloaded.
  4. Tried to create a DB using EF Core but I get an error that says: SqlException: A network-related or instance-specific error occurred while establishing a connection to SQL Server.
  5. I ran "sqllocaldb info" in command prompt to see what databases are there on my device: MSSQLLocalDB and ProjectModels.

What could be the problem because this is my first time seeing this error.

I have attached images to this. If anyone has ever encountered this problem please explain how you overcame it. This is a new Blazor Server Project.

  1. VS: Visual Studio IDE 2022 Version 17.6.2
  2. OS: Windows 11 Pro Version 22H2

Thanks.

ATTACHMENTS:

Error

Registry values

Nothing under SQL Server

SQL Server Express 2019 LocalDB is correctly installed

databases on my device

Russell Chidhakwa
  • 339
  • 2
  • 5
  • 16
  • 2
    "Failed to start" is telling you that it exists but, well, failed to start. Check the event viewer and the LocalDB error log (`%USERPROFILE%\AppData\Local\Microsoft\Microsoft SQL Server Local DB\Instances\mssqllocaldb\error.log`). – Jeroen Mostert Jun 09 '23 at 08:26
  • If you `SqlLocalDb.exe info MSSQLLocalDB` and `SqlLocalDb.exe info ProjectModels` have you started any of the instances yet? Ref: [SqlLocalDB utility](https://learn.microsoft.com/en-us/sql/tools/sqllocaldb-utility) – AlwaysLearning Jun 09 '23 at 08:45
  • @AlwaysLearning: good question. the instances were stopped and I tried to start them but the error said cannot start automatic instances, I deleted the localdb instance and tried to create it and the error says SQL Server process failed to start. I am looking around to understand more of this. – Russell Chidhakwa Jun 09 '23 at 08:55
  • Check the error logs as mentioned – Charlieface Jun 09 '23 at 09:34

1 Answers1

0

I checked the error logs and saw a message stating something like “there have been 256 misaligned log IOs which required falling back to synchronous IO”.

I searched and found out that the error is usually associated with Windows 11 and Modern SSD. Windows 11 doesn’t behave the same way as Windows 10 when it comes to disk sector sizes on modern SSDs.

This article talked about how to troubleshoot OS 4KB disk sector size issues: https://learn.microsoft.com/en-us/troubleshoot/sql/database-engine/database-file-operations/troubleshoot-os-4kb-disk-sector-size

error is solved.

Russell Chidhakwa
  • 339
  • 2
  • 5
  • 16