This repository has been archived by the owner on Jun 16, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 183
NullReferenceException registering Plugin in simulated pipeline #573
Milestone
Comments
Excellent! Thanks Ben! |
I'm getting the same error in another recent solution which has pretty much the same architecture, same versions of SDK, etc. I think that means I can create a copy of this solution, remove all superfluous projects, one by one, see if it still fails, and remove anything else, stripping it down to the bare minimum and see if I can identify the problem. |
Hi Ben , Thanks a mill for reporting this! Yes, I think the plugin registration step should, at the very least, check if there is no EntityTypeCode and if so, fallback to use the EntityLogicalName, maybe. Or else just use the logical name. |
Related to #496 |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Describe the bug
Registering a plugin step in the XrmFakedContext is giving me 'Null Reference Exception: Object reference not set to an instance of an object'. Am I missing something in the registration?
To Reproduce
See screenshot below - my test isn't even gettin past the Initialization stage, so the test itself is not running.
I'm Initializing the Faked Context, setting UsePipelineSimulation to true, and then immediately trying to register a plugin and it fails.
** FakeXrmEasy and Dynamics 365 / CRM version **
FakeXrmEasy v9 (1.57.1). Core Assemblies v 9.0.2.34
Screenshots
The only other thing that might be worth noting is that when I accidentally didn't specify the entity that it was being registered against (like this:
_fakedContext.RegisterPluginStep("Create", ProcessingStepStage.Preoperation, ProcessingStepMode.Synchronous);
the registration didn't fail (but then the plugin failed because it was firing on every single create of every entity).
Any ideas what I might be doing wrong?
The text was updated successfully, but these errors were encountered: