Developing .NET on ARM – Part 1: LocalDB and SQL Server Compatibility Issues

I recently purchased a Copilot PC with an ARM processor and began exploring its potential for .NET development. Almost immediately, I ran into issues related to LocalDB and SQL Server compatibility.

In this article, I’ll explain how I mitigated these problems using Docker and a special version of SQL Server.

LocalDB on ARM problem

When I tried to run a migration using EF Core, I received an error message stating that it was unable to load SQLUserInstance.dll:

A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 56 – Unable to load the SQLUserInstance.dll from the location specified in the registry. Verify that the Local Database Runtime feature of SQL Server Express is properly installed.)

Note: Currently, neither LocalDB nor any version of SQL Server (full or Express) is supported on Windows running on ARM.

Solution: Run SQL Server on Linux via Docker

Azure SQL Edge is a lightweight, cross-platform version of SQL Server designed for edge computing and IoT, and it runs natively on ARM64 — making it a great fit for ARM-based Windows development environments.

Ensure WSL and Docker Desktop are installed on your system.

Step 1: Download the image

Pull the Azure SQL Edge image:

docker pull mcr.microsoft.com/azure-sql-edge

Step 2: Start the Container

You can start the container with a simple docker run command, but I prefer using a Docker Compose.

Here’s an example docker-compose.yml file:

version: '3.8'
services:
  sqlserver:
    image: mcr.microsoft.com/azure-sql-edge
    container_name: sqlserver
    ports:
      - "1433:1433"
    environment:
      SA_PASSWORD: "YourPassword"
      ACCEPT_EULA: "Y"
    volumes:
      - sql_data:/var/opt/mssql
volumes:
  sql_data:

In the same folder where you saved the docker-compose.yml file, start the container with the command docker-compose up -d in the terminal.

docker-compose up -d

Testing the Connection

Use your preferred tool to test the connection.

For example, with SQL Server Management Studio:

  • Server Type: Database Engine
  • Server Name: localhost
  • Authentication: SQL Server Authentication
  • Login: sa
  • Password: YourPassword (or the password you set in the Docker Compose file)

Success!

Running SQL Server via Docker on ARM devices is a practical workaround until native support improves. While this setup may not suit every scenario, it works well for local development and prototyping.

Comments (0)

Start the conversation!