Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

C#

Sam Chaudry
Sam Chaudry
25,519 Points

I'm getting Web API error

Hi

I'm running visual studio on my mac building a web api on the C sharp course. However I keep getting the following:

"ExceptionMessage": "Could not resolve host '(localdb)'", "ExceptionType": "System.Net.Sockets.SocketException",

I have updated visual studio and still nothing. It has only started to happen after using the nuget package manager. Any help would be much appreciated...

2 Answers

Robert Stefanic
Robert Stefanic
35,170 Points

Your application is trying to connect to an instance of LocalDB, but it can't connect. If you're using a Mac, then the reason it can't connect is because LocalDB doesn't exist for Mac.

You'll have to either set up different database and connect to it or run LocalDB in some kind of container.