-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Custom Static Analysis Rules with DacFx 150 Not Executed on Build from VS 2022 Command Line #364
Comments
I verified building the same rules with DacFx 160, which is the one VS 2022 uses, fixes the problem. The reason that rules compiled with DacFx 150 cannot be loaded in VS 2022 is that MEF for some reason cannot match the types. Here's the debug message from MEF trying to load the custom rules: |
as workaround, rebuild the custom rules using DacFx 160 |
@llali - This issue stems from a support case where we observed this issue with the custom rules (SqlServer.Rules) from https://github.com/tcartwright/SqlServer.Rules/releases. Are you suggesting that it's not a problem with VS 2022/SSDT, but the way the custom rules were built/compiled? I'm not familiar with this aspect of Custom Rules, so I'm requesting clarification. Is this something that the custom rules developer must do? |
Here are instructions that @llali created and I'm passing along for how to get the rules built in the SqlServer.Rules repo and get them to play nicely with VS 2022 (and its command-line equivalent):
Root cause appears to be that MEF has a problem with assembly version changes (150.x.x vs 160.x.x) |
Thanks @chlafreniere and @llali for your work on this!!! |
as mentioned above this is by design. If the rules are compiled with DacFx 150, they cannot be used in a SQL project building with dacfx 160. Please compile the rules with latest version of dacfx. additional warnings are added to build diagnostic logs so user gets some information about why rules are not loaded |
Repro steps to be added subsequently
Steps to Reproduce:
Expected: Build should show the message from the custom rule as warning
Actual: There's no warning
Did this occur in prior versions? If not - which version(s) did it work in?
(DacFx/SqlPackage/SSMS/Azure Data Studio)
The text was updated successfully, but these errors were encountered: