0

I have build and extended the Static SQL Code Analysis Rules of SSDT projects. Its working perfectly in my local system by copying the class library DLL into "C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\Extensions\Microsoft\SQLDB\DAC\140\Extensions" location.

Now, My challenge is to share this dll to others developer. How this can be easily shared ?. I don't want this one to be copied manually to the DAC extension folder by everyone.

It should be like a nuget package or an extension upon downloading of that should be installed in the user DAC extension folder.

Can anyone help me here ? How this can be achieved ?

I tried to create an VSIX Extension project and tried to install the custom rule dll into the "C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\Extensions\Microsoft\SQLDB\DAC\140\Extensions" directory. But i failed to do so.

Post build event : copy "$(TargetDir)\TSqlRules$(TargetExt)" "$(ProgramFiles)\Microsoft Visual Studio\2017\Professional\Common7\IDE\Extensions\Microsoft\SQLDB\DAC\140\Extensions\TSqlRules$(TargetExt)" /y

Custom Rule DLL should be installed in "C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\Extensions\Microsoft\SQLDB\DAC\140\Extensions" directory.

1 Answers1

0

It should be like a nuget package or an extension upon downloading of that should be installed in the user DAC extension folder.

Not sure about the best way to do this. But for your simple requirement, nuget package is more convenient than the vs extension if all you want is to share a single dll to specified location.

You can include Init.ps1 file and your xxx.dll when you create your package. And type the copy command into Init.ps1 (similar to what you do in post-build-event).When your nuget package is consumed by any project in VS IDE, it will call the power shell script Init.ps1. Then the ps script can work to copy the xxx.dll from packages folder to destination location.

Related link: Run power shell script during nuget package installation and removal.

LoLance
  • 25,666
  • 1
  • 39
  • 73