microsoft / microsoft/DacFx

AdditionalDeploymentContributorPaths is not honoured / does not seem to work as expected

Open
#528 9 comments 4 reactions 0 assignees View on GitHub
bug
Dominant language
C#
Stars
460
Forks
29
Avg merge
4d 9h
Merged PRs (30d)
7

Description

- SqlPackage or DacFx Version: `162.4.92.3` (latest as at 20 November 2024)
- .NET Framework (Windows-only) or .NET Core:
- Dotnet version: `9.0.100`
- MSBuild version: `MSBuild version 17.12.6+db5f6012c for .NET Framework 17.12.6.51805`
- Environment (local platform and source/target platforms): Windows 11

**Steps to Reproduce:**

1. Run the `.\repro.ps1` script within the following bug reproduction repository: https://github.com/DanielLoth/sqlpackage-bug-repro-1

**Did this occur in prior versions? If not - which version(s) did it work in?**
- I do not think it has worked in previous versions.

(DacFx/SqlPackage/SSMS/Azure Data Studio)

**Output from the repro script linked above:**

```text
----------------------------
Cleanup up running processes
----------------------------

ERROR: The process "dotnet.exe" not found.
ERROR: The process "vbcscompiler.exe" not found.
ERROR: The process "vctip.exe" not found.
ERROR: The process "msbuild.exe" not found.
ERROR: The process "sqlpackage.exe" not found.

-----------------------------------
DONE: Cleaning up running processes
-----------------------------------

------------------------------
REPRO SCRIPT EXECUTION DETAILS

MSBuild version: MSBuild version 17.12.6+db5f6012c for .NET Framework 17.12.6.51805
SqlPackage version: 162.4.92.3
Dotnet version: 9.0.100

PATH environment variable:
C:\windows\system32;C:\Personal\sqlpackage-bug-repro-1\dotnet;C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\amd64;C:\Personal\sqlpackage-bug-repro-1\sqlpackage;
------------------------------

Restore complete (0.2s)
MyContributor succeeded (0.2s) → MyContributor\bin\Release\netstandard2.1\MyContributor.dll

Build succeeded in 0.8s
Restore complete (0.2s)
MyContributor succeeded (0.2s) → MyContributor\bin\Debug\netstandard2.1\publish\

Build succeeded in 0.7s

Creating a model to represent the project...
Loading project references...
Loading project files...
Building the project model and resolving object interdependencies...
Validating the project model...
Writing model to C:\Personal\sqlpackage-bug-repro-1\ReproDB\obj\Release\Model.xml...
ReproDB -> C:\Personal\sqlpackage-bug-repro-1\ReproDB\bin\Release\ReproDB.dll
ReproDB -> C:\Personal\sqlpackage-bug-repro-1\ReproDB\bin\Release\ReproDB.dacpac

-----------------------------
Expect this execution to FAIL
-----------------------------

Generating publish script for database 'MyDB'.
*** An error occurred during deployment plan generation. Deployment cannot continue.
Error SQL0: Required contributor with id 'MyDeploymentContributor' could not be loaded.

Contributor initialization error.
Time elapsed 0:00:01.43

------------------------
END OF FAILING EXECUTION
------------------------

-------------------------------------------------------------------
Expect this execution to PASS
(Expect to see 'Hello world') written to console by the contributor
-------------------------------------------------------------------

Generating publish script for database 'MyDB'.
Hello world
Successfully generated script to file C:\Personal\sqlpackage-bug-repro-1\out\Script.sql.
Successfully generated report to file C:\Personal\sqlpackage-bug-repro-1\out\Report.xml.
Changes to connection setting default values were incorporated in a recent release. More information is available at https://aka.ms/dacfx-connection
Time elapsed 0:00:01.61

------------------------
END OF PASSING EXECUTION
------------------------

----------------------------
Cleanup up running processes
----------------------------

ERROR: The process "dotnet.exe" not found.
SUCCESS: The process with PID 18060 (child process of PID 27380) has been terminated.
SUCCESS: The process with PID 27380 (child process of PID 26892) has been terminated.
ERROR: The process "vctip.exe" not found.
ERROR: The process "msbuild.exe" not found.
ERROR: The process "sqlpackage.exe" not found.

-----------------------------------
DONE: Cleaning up running processes
-----------------------------------
```

Contributor guide

Open the contributing guide

Research direction

Start by running the linked repro.ps1 script in the sqlpackage-bug-repro-1 repository and compare its failing and passing executions. Trace how SqlPackage handles AdditionalDeploymentContributorPaths and contributor loading. Done means the expected contributor loads without the workaround and the script reaches the successful deployment output.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, sql
Domain
databases, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.