ErikEJ/EFCorePowerTools

Errors every time when connecting to localDB in a code first VS2020 blazor web app project.

Closed this issue · 7 comments

Create a bug report, feature proposal, or ask a question.

NOTICE: A bug report without sufficient technical and repro details and version information WILL BE CLOSED WITHOUT ANY FURTHER ACTION.

Create an empty VS Blazor web app project.

Create a data class, anything will do.

In VS in the Project, right click Add -> New Scaffolded Item.
Select Razor Component using Entity Framework (CRUD). Click Add.

For Template keep CRUD. Select the model class you created. Create a new DbContext Class. Click Add.

A (localdb)\mssqllocaldb instance is created. In my case under C:\Users\daz.smith\AppData\Local\Microsoft\Microsoft SQL Server Local DB\Instances\mssqllocaldb

Run the app. Test data can be added and viewed , and persists.

All good. Basic stuff.

Now try to connect to that db instance in EF Core Power Tools. Whatever i do doesnt work. I keep getting an error. It does not matter what connection settings I use or options, it yields the same error every time. VS Blazor scaffolding has created the localDB connection and data. It is there. There connection string is for a localDB ...

"Server=(localdb)\mssqllocaldb;Database=Licenses;Trusted_Connection=True;MultipleActiveResultSets=true"

... but power tools just won't connect.

I cannot populate database name because the connection to the instance isn't working so nothing is retrieved here.

image

If i try custom connection , using connection string as above with MYSQL selected, another error is generated:

image

Provide technical details

  • EF Core Power Tools version: 2.6.417

  • Exact Visual Studio version: (e.g. Visual Studio 2022 17.10.4

  • Database engine: not sure! NET8 has it's own configured from the DbContext you use. I'm a beginner so not sure. Think it's MYSQL

  • EF Core version in use: (e.g. EF Core 8)

  • Is Handlebars templates used: no

  • Is T4 templates used: no

  • Is a SQL Server .dacpac used: no

I think you have an extra \ in the name

Have you tried without the double \ ??

Great!

If you like my free tools, I would be very grateful for a rating or review on Visual Studio Marketplace or even a one-time or monthly sponsorship