GoEddie / DeploymentContributorFilterer

MIT License
69 stars 34 forks source link

How to debug the SqlPackageFilter assembly? #14

Closed martinsmith123456 closed 5 years ago

martinsmith123456 commented 5 years ago

Hello,

I'd like to be able to step through the code in the filter as it is being called when generating a deploy script from a dacpac.

I assume you must have done this during development. If so what is the best way of doing this?

Martin

(PS: The issue I am looking into is one where I am seeing unnamed constraints being scripted for objects in a schema that should be ignored - I'll submit a pull request once I've got to the bottom of this)

YanumVlad commented 5 years ago

Hi,

  1. Deploy contributor to proper place
  2. Open SSDT with database project to be deployed.
  3. Open Visual Studio with source code of contributor
  4. Add break point
  5. Attach to #2 process from #3 VS via Debug -> Attach to process -> (Select devenv.exe)
  6. Publish / generate scripts from SSDT

Break point will come into play then :)

Enjoy!

martinsmith123456 commented 5 years ago

Thanks very much for the speedy reply.

I also came across another method I'll share in case anyone else finds useful.

martinsmith123456 commented 5 years ago

Regarding the issue itself I can see the problem. ShouldRemoveFromPlan is being passed an empty string as ObjectIdentifier name for unnamed constraints so things like schema checks based on this don't work - will see if I can find a nice way of solving this.