2

I've been tinkering around with .NET Core through visual studio code on a Mac operating system, however, Entity Framework is giving me some trouble. I'm perfectly able to migrate but cannot run the > dotnet ef database update command without getting following error: LocalDB is not supported on this platform. I've been researching around, and it seems that the issue could be related to the operating system, how can I workaround this and conclusively have a working database to migrate to.

Thom A
  • 88,727
  • 11
  • 45
  • 75
NowsyMe
  • 121
  • 1
  • 2
  • 2
    Possible duplicate of [How to add local database file to Visual Studio Mac 2017](https://stackoverflow.com/questions/44866441/how-to-add-local-database-file-to-visual-studio-mac-2017) – Daniel A. Thompson Jun 08 '18 at 14:52

2 Answers2

3

The message : "LocalDB is not supported on this platform." is correct. LocalDB using .mdf file is not working under MacOSX, as the file needs a hidden "SQLExpress" server layer. This is not yet implemented on MacOS. So neither VS Code, nor VS Studio will do this job out of the box on a Mac.

You can overcome this problem using docker, which can run a containerized version of SQLServer for Linux. You will need to learn docker a bit, to copy your file inside the container and mount it to SQLServer as database, but nothing really hard if you are familiar to the unix commandline world. Requires also the installation of docker for mac, and will have some (small) limitation inside SQLServer itself, due to the linux version not beeing 100% the same as windows one.

Have fun !

gis
  • 56
  • 5
0

I use VS Code on MAC. As instructed in Github..\eShopOnWeb: I tried.. docker-compose build docker-compose up Upon last cmd-line, error shown: "Network nat declared as external, but could not be found. Please create the network manually using docker network create nat and try again." I refd. Create networks automatically in Docker Compose and found soln as: Edit docker-compose.yml file for network as networks: default: That's it. I could open website in browser.

niranjan
  • 19
  • 2