Make assembly scanning optional and fix AutoRegisterInputType reallocation (#749) - #750
Merged
Merged
Conversation
…ation (microsoft#749) Add ReSettings.EnableAssemblyScanning (default true) to opt out of the AppDomain-wide [DynamicLinqType] scan in CustomTypeProvider. Stop reassigning ReSettings.CustomTypes on every workflow registration when no new types are discovered, which previously broke the ReferenceEquals cache in RuleExpressionParser and forced a fresh scan each time.
Sagar Surendra Ambilpure (sagarambilpure)
approved these changes
Sep 11, 2026
YogeshPraj
enabled auto-merge (squash)
September 11, 2026 17:16
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #749.
1. Assembly scanning is now optional
Adds
ReSettings.EnableAssemblyScanning(defaulttrue, preserving current behavior). Whenfalse,CustomTypeProviderskips the AppDomain-wide scan for[DynamicLinqType]-marked types done byDefaultDynamicLinqCustomTypeProvider. Only explicitly suppliedCustomTypes(plus auto-registered input types) are registered, avoiding the scan cost.2. AutoRegisterInputType no longer reallocates CustomTypes every registration
RegisterRulepreviously ran_reSettings.CustomTypes = collector.ToArray()unconditionally on each workflow registration, replacing the array reference every time. That broke theReferenceEqualscache inRuleExpressionParser.GetParsingConfig()and forced a newCustomTypeProvider(and a fresh assembly scan) each time. The array is now only swapped when new types are actually discovered.Changes
ReSettings: newEnableAssemblyScanningproperty (+ copy constructor).CustomTypeProvider: newenableAssemblyScanningoverload; skipsbase.GetCustomTypes()when disabled.RuleExpressionParser: threads the flag into the parsing config and settings fingerprint.RulesEngine.RegisterRule: only reassignCustomTypeswhen the collected set changed.Issue749Test.cs(6 tests).CHANGELOG.mdupdated under Unreleased.Testing
Full unit suite passes: 184/184 (net9.0).
Note on #747 (digital signatures)
#747 is a signing/governance question, not a code change. RulesEngine assemblies are strong-name signed but not Authenticode-signed; adding Microsoft ESRP Authenticode signing to the release pipeline is a maintainer/infra decision and is out of scope for this PR.