Potentially incorrect and annoying message: "This project uses SQL Server Express LocalDB"

Ive updated one of my asp.net web applications in Visual Studio 2015. After the update, I continue to receive this message: "This project uses SQL Server Express LocalDB. Microsoft recommends using SQL Server Express with IIS"

This project uses SQL Server Express LocalDB. Microsoft recommends using SQL Server Express with IIS

No matter what I select β€œYes” or β€œNo”, I always get a popup every time I start F5. I do not have LocalDB. This should be a bug in VS05. What are my workarounds?

+8
source share
2 answers

If your applications use EF5, then LocalDB is used by default. you can change this in web.config to use SQL Server.

Search for: LocalDB

<defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework"> <parameters> <parameter value="v11.0" /> </parameters> </defaultConnectionFactory> 

and replace it with using Sql Server.

Sql Server

 <defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework"> <parameters> <parameter value="Data Source=YOURDATABASEHERE; Integrated Security=True; MultipleActiveResultSets=True" /> </parameters> </defaultConnectionFactory> 

+6
source

I tried the Mike solution, but the error will still be shown, and finally it will disappear after adding the full assembly reference with the public key token.

So basically I replaced

 <entityFramework> <defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework"> <parameters> <parameter value="mssqllocaldb" /> </parameters> </defaultConnectionFactory> <providers> <provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" /> </providers> </entityFramework> 

WITH

 <entityFramework> <defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL"> <parameters> <parameter value="Data Source=localhost; Integrated Security=True; MultipleActiveResultSets=True" /> </parameters> </defaultConnectionFactory> <providers> <provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL" /> </providers> </entityFramework> 
0
source

Source: https://habr.com/ru/post/1243979/


All Articles