dsccommunity / dsccommunity/SqlServerDsc

SqlReplication: Refactor resource to not use Load()

Open
#1,352 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

breaking change enhancement help wanted
Dominant language
PowerShell
Stars
385
Forks
224
PR merge metrics
No merged PRs in 30d

Description

Details of the scenario you tried and the problem that is occurring

This resource is dependent on loading an assembly from the GAC for it to be able to create the objects it uses.

Verbose logs showing the problem

n/a

Suggested solution to the issue

We should instead refactor it so it does not need to use Load(), which is version dependent to load the correct assembly for the correct SQL Server version. But instead use SQLPS or SqlServer module to get the assrmbly loaded into the session.

Looked into if there was another way to create the types needed in this resource, instead of using Load(). But neither SQLPS och SqlServer module loads the necessary assembly. So the only way might be to load the assembly directly from the GAC using Load().

The DSC configuration that is used to reproduce the issue (as detailed as possible)

n/a

SQL Server edition and version the target node is running

n/a

SQL Server PowerShell modules present on the target node

n/a

The operating system the target node is running

All

Version and build of PowerShell the target node is running

n/a

Version of the DSC module that was used ('dev' if using current dev branch)

Dev

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No file, test, or entry point is named. Start by locating the SqlReplication resource and its Load() usage, then inspect how the SQLPS or SqlServer module exposes the required assemblies; done means the resource no longer depends on version-sensitive loading while still creating its required types.

Written by the indexing model from the issue text.

Assessment

Tech stack
powershell, sql
Domain
databases
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.