-
Notifications
You must be signed in to change notification settings - Fork 17
Open
Labels
questionFurther information is requestedFurther information is requested
Description
I am using FakeXrmEasy v2.8.0.
When registering a plugin step without an instance like
context.RegisterPluginStep<Plugin1>(new PluginStepDefinition()
{
MessageName = Plugins.Utils.Utils.MessageNames.Update,
EntityLogicalName = Account.EntityLogicalName,
Stage = FakeXrmEasy.Abstractions.Plugins.Enums.ProcessingStepStage.Postoperation,
});and then causing the step to trigger with an update, FakeXrmEasy tries to build the method handle to ExecutePluginWith, which has the type parameter T with a constraint to IPlugin and new(). My plugin doesn't have an empty constructor, it only has the one with both config string parameters. This error is thrown during runtime:
System.ArgumentException: GenericArguments[0], 'Core.Plugins.Account.Plugin1', on 'Microsoft.Xrm.Sdk.IPlugin ExecutePluginWith[T](FakeXrmEasy.Pipeline.Scope.EventPipelineScope)' violates the constraint of type 'T'.
The CRM handles this just fine but FakeXrmEasy doesn't like it.
Please either handle this correctly while constructing the method handle or add a new() constraint on RegisterPluginStep to catch this during compilation.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
questionFurther information is requestedFurther information is requested