0

I'm trying EF Core and I'm using the example in this link https://learn.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:

2 Answers 2

1

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

2
  • I did that now i m getting> System.Data.SqlClient.SqlException: 'Failed to generate SSPI context. My connection string is = optionsBuilder.UseSqlServer( @"Server=.;Database=DatabaseName;Trusted_Connection=True;"
    – NKF
    Sep 30, 2018 at 21:16
  • Any thoughts? I know that the connection string is correct because if I test it with a .NET Core 2.1 console project it works fine, however using UWP project throws the error: Failed to generate SSPI context. ErrorCode=NoCredentials
    – NKF
    Sep 30, 2018 at 22:09
0

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.