DACPAC deployment fails on Linux/WSL2 with invalid path separators
Description
After updating to version 1.5.5, DACPAC deployment fails on Linux/WSL2 environments because the extension uses Windows-style backslashes (\) in file paths instead of Unix-style forward slashes (/).
Environment
- Extension: SQL Database Projects (
ms-mssql.sql-database-projects-vscode)
- Version: 1.5.5 (broken), 1.5.4 (worked)
- VS Code: Insiders
- OS: Linux (WSL2) -
6.6.87.2-microsoft-standard-WSL2
- Platform: x86_64 GNU/Linux
Steps to Reproduce
- Create a SQL Database Project (
.sqlproj) on Linux/WSL2
- Build the project successfully using
dotnet build
- Verify DACPAC is created at:
/path/to/project/bin/Debug/MyProject.dacpac
- Attempt to deploy DACPAC using the extension's "Deploy" command
Expected Behavior
DACPAC should deploy successfully using the correct Unix path:
/path/to/project/bin/Debug/MyProject.dacpac
Actual Behavior
Deployment fails with error:
Deploy dacpac: Failed. Could not load package from '/path/to/project/bin\Debug\/MyProject.dacpac'.
Could not find a part of the path '/path/to/project/bin\Debug\/MyProject.dacpac'.
Notice the mixed path separators: /path/to/project/bin\Debug\/MyProject.dacpac
- First part uses forward slashes:
/path/to/project/bin
- Last part uses backslashes:
\Debug\
Root Cause
The extension appears to be constructing paths using Windows path separator (\) on Linux systems. This likely happened in the v1.5.5 update.
Workaround
Deploy individual SQL files manually via SQL Server extension instead of using DACPAC deployment.
Additional Context
- Build command works correctly and produces valid DACPAC file
- DACPAC file exists at the expected location with correct permissions
- The issue only appeared after updating from v1.5.4 to v1.5.5
- Build output directory path in terminal shows:
Cwd: \workspace\... (note backslashes on Linux)
Regression
✅ Worked in: v1.5.4
❌ Broken in: v1.5.5
Suggested Fix
Use path.join() or similar cross-platform path utilities instead of hardcoded path separators when constructing file paths.
DACPAC deployment fails on Linux/WSL2 with invalid path separators
Description
After updating to version 1.5.5, DACPAC deployment fails on Linux/WSL2 environments because the extension uses Windows-style backslashes (
\) in file paths instead of Unix-style forward slashes (/).Environment
ms-mssql.sql-database-projects-vscode)6.6.87.2-microsoft-standard-WSL2Steps to Reproduce
.sqlproj) on Linux/WSL2dotnet build/path/to/project/bin/Debug/MyProject.dacpacExpected Behavior
DACPAC should deploy successfully using the correct Unix path:
Actual Behavior
Deployment fails with error:
Notice the mixed path separators:
/path/to/project/bin\Debug\/MyProject.dacpac/path/to/project/bin\Debug\Root Cause
The extension appears to be constructing paths using Windows path separator (
\) on Linux systems. This likely happened in the v1.5.5 update.Workaround
Deploy individual SQL files manually via SQL Server extension instead of using DACPAC deployment.
Additional Context
Cwd: \workspace\...(note backslashes on Linux)Regression
✅ Worked in: v1.5.4
❌ Broken in: v1.5.5
Suggested Fix
Use
path.join()or similar cross-platform path utilities instead of hardcoded path separators when constructing file paths.