Extensions discovery issue in DacPac's DacServices.Deploy()
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 460
- Forks
- 29
- Avg merge
- 4d 9h
- Merged PRs (30d)
- 7
Description
Due to specifics of our application we load the assembly Microsoft.SqlServer.Dac.dll, as well as all other it relies on, by leveraging the method[ Assembly.Load(byte[])](https://docs.microsoft.com/en-us/dotnet/api/system.reflection.assembly.load?view=netcore-3.1#System_Reflection_Assembly_Load_System_Byte___). Then, once we call DacServices.Deploy(), it fails with the below ArgumentException:

because its implementation:

is not ready to handle the contract of [Assembly.Location](https://docs.microsoft.com/en-us/dotnet/api/system.reflection.assembly.location?view=netcore-3.1) saying: "_... If the assembly is loaded from a byte array, such as when using the Load(Byte[]) method overload, the value returned is an empty string ("") ..._"
So, the above ArgumentException is because Path.GetDirectoryName was supplied an empty string. The code should verify the property Assembly.Location for an empty string prior trying to use it.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by inspecting the DacServices.Deploy() extension-discovery implementation shown in the issue and reproduce the failure with assemblies loaded through Assembly.Load(byte[]). Done means deployment no longer throws when Assembly.Location is empty; the issue does not name a source file or test to run.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp, sql
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100