How to install LocalDB 2016 along with Visual Studio 2017?
Asked Answered
I

9

23

After installing Visual Studio 2017 with the SQL Server Data tools feature checked, I noticed LocalDB was not installed. How can I add SQL Server LocalDB 2016 to my Visual Studio 2017 installation? Did I miss a checkbox when installing VS2017, or is it simply not included with the installer? If so, how do I configure VS2017 so I can view and connect to my manually installed LocalDB database in Visual Studio's server browser?

Iridectomy answered 13/3, 2017 at 22:40 Comment(3)
Add it as an optional componentPressure
I have similar problem, local db is isntalled but cannot found inside Visual Studio 2017.Waitabit
@Pressure I can't find the option in the Visual Studio installer.Iridectomy
I
27

It's automatically installed if .NET Desktop Development is checked. You can check it in the Summary. Visual Studio 2017 installation wizard

Ing answered 16/3, 2017 at 14:32 Comment(0)
B
22

SQL Server Express 2016 LocalDB is in .NET desktop development. If you missed it to select while installing Visual Studio 2017, you can select and install it later.

To install SQL Server Express 2016 LocalDB, go to Start in your Windows OS, type Visual Studio Installer and run it. Then click Modify. It will open the Workloads selection screen where you can select .Net desktop development. .Net desktop development includes SQL Server Express 2016 LocalDB. After selecting, click Modify and you are done.

But although you select .NET desktop development, it may not install. Because SQL Server 2016 or later is not supported for many processors. To check this, visit Hardware and Software Requirements for Installing SQL Server If this is your case, then you have to depend on SQL Server Express 2014 LocalDB or previous.

To install SQL Server Express 2014 LocalDB manually, download the installer from Microsoft® SQL Server® 2014 Service Pack 2 (SP2) Express and install SQL Server Express 2014 LocalDB by running the installer.

To connect to LocalDB, open Server Explorer in Visual Studio, right-click on Data Connections-> Add Connection. Enter Server name: (localdb)\MSSQLLocalDB and Test Connection. If test is success, click OK and you are now connected.

Blighter answered 4/11, 2017 at 9:36 Comment(3)
How do I open Server Explorer in VS? I tried searching in help for it, but no results were found.Unclear
"View->Server Explorer" or keyboard shortcut - ctrl + alt + SBlighter
I figured out what I was missing. I was following a tutorial on Pluralsight, Bethany's Pie Shop, "Building Your First ASP.NET Core 2.0 MVC Application VS 2017", and tried running solution downloaded. I had a failed login message... I re-watched a couple of the videos. This is what I was missing. I needed (in VS) to go to file->other windows->PkgMgrConsole - Make sure you've built the application (build solution at top of VS) - in console at bottom.... add-migration InitialMigration - in console.... update_database - run programUnclear
P
6

It is a component under the .NET desktop development workload.

Pressure answered 14/3, 2017 at 20:43 Comment(0)
O
4

New to the conversation, but wanted to share what I ran into because it may not be apparent that localdb was installed already. Here's another step you can take to verify.

I ran into this same issue and found out that I'd already installed localdb via desktop.

I was getting a connection string error and thought I did something wrong, but what I ended up doing is opening the SQL Server Object Explorer from within Visual Studio and sure enough, it was there.

Shortcut, Ctrl+\ & Ctrl+S, or View -> SQL Server Object Explorer.

Olwena answered 21/3, 2018 at 4:38 Comment(0)
P
4

As others have pointed out, LocalDB is automatically included if you select certain workloads, such as Desktop or ASP.Net.

However, you may not want one of those workloads. You may just want to add LocalDB.

In the Visual Studio Installer, navigate away from the Workloads tab to the second tab (Individual components). Here, the individual items are listed alphabetically, and can be selected or deselected for installation:

enter image description here

Plasterwork answered 24/7, 2018 at 15:49 Comment(0)
S
2

If you choose

ASP.NET and web development

then the option

SQL Server Express 2016 LocalDB

will also be checked and installed.

Stronski answered 1/12, 2017 at 9:50 Comment(0)
T
1

I have the same issue here, I followed the accepted answer but I think nothing has been installed. I followed the installer, and everything was checked ever since I installed my Visual Studio 2017 Professional Edition:

enter image description here

enter image description here

After all successful installation, and tried to modify it again using the installer, it will show the that I need to download the same tools which I installed multiple times. In other words, I have the same window as my image I showed above even though I already installed and modified it several times. And LocalDb still is not yet installed.

So I directly downloaded it here, you can even choose your own version: SQL Server Express LocalDB

Then upon successful installation using the link above, I was now able to confirm that LocalDb has finally installed on my machine.

enter image description here

enter image description here

To query, run command prompt and input:

enter image description here

enter image description here

Thetic answered 17/9, 2020 at 21:53 Comment(0)
U
0

I know this is a little different that what is asked, but the symptom is similar so I'm posting this. I figured out what I was missing. I was following a tutorial on Pluralsight, Bethany's Pie Shop, "Building Your First ASP.NET Core 2.0 MVC Application VS 2017", and tried running the solution downloaded. I had a failed login message... I re-watched a couple of the videos. This is what I was missing. I needed (in VS) to go to View->other windows->PkgMgrConsole - Make sure you've built the application (build solution at top of VS) - in console at bottom.... add-migration InitialMigration - in console.... update-database - run program

The person asking this didn't say how he got to the point that he thought he didn't have localDb installed. I checked, and I had it installed, but it was giving me a failed login message when I tried running the program without these steps.

Unclear answered 22/5, 2018 at 14:10 Comment(0)
E
0

If you use Visual Studio Installer and select only .Net desktop development,it will uninstall all workloads you had before. It's a lengthy process beware.

Engeddi answered 20/9, 2019 at 18:24 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.