Entity Framework Core errors when using local DB

c# entity-framework-core uwp

Question

I'm trying EF Core and I'm using the example in this link https://docs.microsoft.com/en-us/ef/core/get-started/uwp/getting-started

With SQLite, everything works ok, when I try to do the same with Microsoft.FrameWorkCore.SqlServer, I run the Add-Migration and it finishes ok, then I set the UWP app as start up project and after I get the following error:

System.PlatformNotSupportedException: 'LocalDB is not supported on this platform.

Where the UWP app is trying to create the DB, path and folder?

My sqllocaldb information is the following

C:\>sqllocaldb
Microsoft (R) SQL Server Express LocalDB Command Line Tool
Version 13.0.1601.5
Copyright (c) Microsoft Corporation.  All rights reserved.

Usage: SqlLocalDB operation [parameters...]


C:\>sqllocaldb i MSSQLLocalDB
Name:               MSSQLLocalDB
Version:            13.1.4001.0
Shared name:
Owner:              
Auto-create:        Yes
State:              Stopped
Last start time:    
Instance pipe name:

C:\>sqllocaldb i ProjectsV13
Name:               ProjectsV13
Version:            13.1.4001.0
Shared name:
Owner:              
Auto-create:        No
State:              Stopped
Last start time:    
Instance pipe name:
1
0
9/30/2018 6:23:20 PM

Accepted Answer

The UWP SqlClient does not support named pipes, use the free SQL Server Express and enable tcp connections from it.

1
9/30/2018 6:27:46 PM

Popular Answer

Solution: Besides enabling the TCP protocol you have to set the 'Enterprise Authentication' capability in the Package.appxmanifest. Otherwise 'Trusted_Connection=True' doesn't work. From: https://github.com/dotnet/corefx/issues/22890#issuecomment-333305084



Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow