// Connection string string connString = @"Server=(localdb)\MyAppDB;Integrated Security=true";

Use SqlPackage.exe or CREATE DATABASE ... FOR ATTACH to move .mdf files.

-- Start an instance SqlLocalDB start "MyAppDB"

-- Create a named instance SqlLocalDB create "MyAppDB" -s