Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

Getting Error on Registering a Plugin

Posted on by Microsoft Employee

I have written a plugin and built it both in .NET 4.5.2 and 4.6.1 but on registering the assembly, I'm getting error which says

With 4.5.2, getting this

Unhandled Exception: System.ServiceModel.FaultException`1[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, Version=9.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]: Principal user (Id=5d7d81a2-47b1-e811-a98b-000d3a1a7fa7, type=8 , accessMode=0, roleCount=2 ) is missing prvCreatePluginAssembly privilege (Id=c81a03bb-4bfc-45a6-9184-e899ce26811a)
Detail: <OrganizationServiceFault xmlns="schemas.microsoft.com/.../Contracts" xmlns:i="www.w3.org/.../XMLSchema-instance">
<ActivityId>a2311763-791e-4264-b569-f695598311dc</ActivityId>
<ErrorCode>-2147220960</ErrorCode>
<ErrorDetails xmlns:a="schemas.datacontract.org/.../System.Collections.Generic">
<KeyValuePairOfstringanyType>
<a:key>ApiExceptionSourceKey</a:key>
<a:value i:type="b:string" xmlns:b="www.w3.org/.../XMLSchema">Plugin/Microsoft.Crm.ObjectModel.PluginAssemblyService</a:value>
</KeyValuePairOfstringanyType>
<KeyValuePairOfstringanyType>
<a:key>ApiOriginalExceptionKey</a:key>
<a:value i:type="b:string" xmlns:b="www.w3.org/.../XMLSchema">Microsoft.Crm.CrmSecurityException: Principal user (Id=5d7d81a2-47b1-e811-a98b-000d3a1a7fa7, type=8 , accessMode=0, roleCount=2 ) is missing prvCreatePluginAssembly privilege (Id=c81a03bb-4bfc-45a6-9184-e899ce26811a) ---&gt; Microsoft.Crm.CrmSecurityException: Principal user (Id=5d7d81a2-47b1-e811-a98b-000d3a1a7fa7, type=8 , accessMode=0, roleCount=2 ) is missing prvCreatePluginAssembly privilege (Id=c81a03bb-4bfc-45a6-9184-e899ce26811a)
at Microsoft.Crm.BusinessEntities.SecurityLibrary.ThrowCrmSecurityException(SecurityPrincipal principal, Guid privilegeId, Int32 errorCode, ExecutionContext context)
at Microsoft.Crm.BusinessEntities.SecurityLibrary.CheckPrivilege(Guid user, Guid privilege, ExecutionContext context)
at Microsoft.Crm.BusinessEntities.SecurityExtension.PreCreateHandlerEntityPrivilegeCheck(Object sender, SecurityTraits traits, SecurityAttributes attributes, ExtensionEventArgs e)
at Microsoft.Crm.BusinessEntities.SecurityExtension.PreCreateSecurityCheck(Object sender, ExtensionEventArgs e, BusinessEntity entity)
at Microsoft.Crm.BusinessEntities.SecurityExtension.PreCreateHandler(ExtensionEventArgs e, Object sender)
at Microsoft.Crm.BusinessEntities.BusinessProcessObject.PreCreateEventHandler.Invoke(Object sender, ExtensionEventArgs e)
at Microsoft.Crm.BusinessEntities.BusinessProcessObject.&lt;&gt;c__DisplayClass162_0.&lt;Create&gt;b__0()
at Microsoft.PowerApps.CoreFramework.ActivityLoggerExtensions.Execute[TResult](ILogger logger, EventId eventId, ActivityType activityType, Func`1 func, IEnumerable`1 additionalCustomProperties)
at Microsoft.Xrm.Telemetry.XrmTelemetryExtensions.Execute[TResult](ILogger logger, XrmTelemetryActivityType activityType, Func`1 func)
at Microsoft.Crm.ObjectModel.SdkEntityServiceBase.CreateInternal(IBusinessEntity entity, ExecutionContext context, Boolean verifyAction)
--- End of inner exception stack trace ---
at Microsoft.Crm.Extensibility.VersionedPluginProxyStepBase.Execute(PipelineExecutionContext context)
at Microsoft.Crm.Extensibility.PipelineInstrumentationHelper.Execute(Boolean instrumentationEnabled, String stopwatchName, ExecuteWithInstrumentation action, PipelineExecutionContext context)
at Microsoft.Crm.Extensibility.Pipeline.&lt;&gt;c__DisplayClass2_1.&lt;Execute&gt;b__0()</a:value>
</KeyValuePairOfstringanyType>
<KeyValuePairOfstringanyType>
<a:key>ApiStepKey</a:key>
<a:value i:type="b:guid" xmlns:b="schemas.microsoft.com/.../Serialization">3ecabb1b-ea3e-db11-86a7-000a3a5473e8</a:value>
</KeyValuePairOfstringanyType>
<KeyValuePairOfstringanyType>
<a:key>ApiDepthKey</a:key>
<a:value i:type="b:int" xmlns:b="www.w3.org/.../XMLSchema">1</a:value>
</KeyValuePairOfstringanyType>
<KeyValuePairOfstringanyType>
<a:key>ApiActivityIdKey</a:key>
<a:value i:type="b:guid" xmlns:b="schemas.microsoft.com/.../Serialization">a2311763-791e-4264-b569-f695598311dc</a:value>
</KeyValuePairOfstringanyType>
<KeyValuePairOfstringanyType>
<a:key>ApiPluginSolutionNameKey</a:key>
<a:value i:type="b:string" xmlns:b="www.w3.org/.../XMLSchema">System</a:value>
</KeyValuePairOfstringanyType>
<KeyValuePairOfstringanyType>
<a:key>ApiStepSolutionNameKey</a:key>
<a:value i:type="b:string" xmlns:b="www.w3.org/.../XMLSchema">System</a:value>
</KeyValuePairOfstringanyType>
</ErrorDetails>
<Message>Principal user (Id=5d7d81a2-47b1-e811-a98b-000d3a1a7fa7, type=8 , accessMode=0, roleCount=2 ) is missing prvCreatePluginAssembly privilege (Id=c81a03bb-4bfc-45a6-9184-e899ce26811a)</Message>
<Timestamp>2018-09-13T18:15:26.6495816Z</Timestamp>
<ExceptionRetriable>false</ExceptionRetriable>
<ExceptionSource i:nil="true" />
<InnerFault>
<ActivityId>a2311763-791e-4264-b569-f695598311dc</ActivityId>
<ErrorCode>-2147220960</ErrorCode>
<ErrorDetails xmlns:a="schemas.datacontract.org/.../System.Collections.Generic" />
<Message>Principal user (Id=5d7d81a2-47b1-e811-a98b-000d3a1a7fa7, type=8 , accessMode=0, roleCount=2 ) is missing prvCreatePluginAssembly privilege (Id=c81a03bb-4bfc-45a6-9184-e899ce26811a)</Message>
<Timestamp>2018-09-13T18:15:26.6495816Z</Timestamp>
<ExceptionRetriable>false</ExceptionRetriable>
<ExceptionSource i:nil="true" />
<InnerFault i:nil="true" />
<OriginalException i:nil="true" />
<TraceText i:nil="true" />
</InnerFault>
<OriginalException i:nil="true" />
<TraceText i:nil="true" />
</OrganizationServiceFault>

Server stack trace:
at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc& rpc)
at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)

Exception rethrown at [0]:
at Microsoft.Crm.Tools.Libraries.RegistrationHelper.RegisterAssembly(CrmOrganization org, String pathToAssembly, CrmPluginAssembly assembly)
at Microsoft.Crm.Tools.AssemblyRegistration.PluginRegistrationViewModel.btnregisterClick()

With 4.6.1, getting this

Unhandled Exception: System.ServiceModel.FaultException`1[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, Version=9.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]: This plugin assembly uses version 4.6.1 of the .NET Framework. At this time Microsoft Dynamics 365 requires version 4.5.2 of the .NET Framework for plugin assemblies. Rebuild this assembly using .NET Framework version 4.5.2 and try again.
Detail: <OrganizationServiceFault xmlns="schemas.microsoft.com/.../Contracts" xmlns:i="www.w3.org/.../XMLSchema-instance">
<ActivityId>d27876be-8193-4576-b2e0-9ce7913943b7</ActivityId>
<ErrorCode>-2147204597</ErrorCode>
<ErrorDetails xmlns:a="schemas.datacontract.org/.../System.Collections.Generic">
<KeyValuePairOfstringanyType>
<a:key>ApiExceptionSourceKey</a:key>
<a:value i:type="b:string" xmlns:b="www.w3.org/.../XMLSchema">Plugin/Microsoft.Crm.ObjectModel.PluginAssemblyService</a:value>
</KeyValuePairOfstringanyType>
<KeyValuePairOfstringanyType>
<a:key>ApiOriginalExceptionKey</a:key>
<a:value i:type="b:string" xmlns:b="www.w3.org/.../XMLSchema">Microsoft.Crm.CrmException: This plugin assembly uses version 4.6.1 of the .NET Framework. At this time Microsoft Dynamics 365 requires version 4.5.2 of the .NET Framework for plugin assemblies. Rebuild this assembly using .NET Framework version 4.5.2 and try again. ---&gt; Microsoft.Crm.CrmException: This plugin assembly uses version 4.6.1 of the .NET Framework. At this time Microsoft Dynamics 365 requires version 4.5.2 of the .NET Framework for plugin assemblies. Rebuild this assembly using .NET Framework version 4.5.2 and try again.
at Microsoft.Crm.ObjectModel.TargetFrameworkVersionValidator.ValidateInternal()
at Microsoft.Crm.ObjectModel.PluginValidatorBase.Validate()
at Microsoft.Crm.ObjectModel.PluginAssemblyServiceInternal`1.ValidateAssemblyMetadata(ExecutionContext context, IBusinessEntity pluginAssembly, CrmPluginAssemblyMetadata assemblyMetadata)
at Microsoft.Crm.ObjectModel.PluginAssemblyServiceInternal`1.VerifyRegistrationAbility(IBusinessEntity pluginAssembly, Boolean createCall, ExecutionContext context, CrmPluginAssemblyMetadata assemblyMetadata)
at Microsoft.Crm.ObjectModel.PluginAssemblyServiceInternal`1.ValidateOperation(String operationName, IBusinessEntity entity, ExecutionContext context)
at Microsoft.Crm.ObjectModel.SdkEntityServiceBase.CreateInternal(IBusinessEntity entity, ExecutionContext context, Boolean verifyAction)
--- End of inner exception stack trace ---
at Microsoft.Crm.Extensibility.VersionedPluginProxyStepBase.Execute(PipelineExecutionContext context)
at Microsoft.Crm.Extensibility.PipelineInstrumentationHelper.Execute(Boolean instrumentationEnabled, String stopwatchName, ExecuteWithInstrumentation action, PipelineExecutionContext context)
at Microsoft.Crm.Extensibility.Pipeline.&lt;&gt;c__DisplayClass2_1.&lt;Execute&gt;b__0()</a:value>
</KeyValuePairOfstringanyType>
<KeyValuePairOfstringanyType>
<a:key>ApiStepKey</a:key>
<a:value i:type="b:guid" xmlns:b="schemas.microsoft.com/.../Serialization">3ecabb1b-ea3e-db11-86a7-000a3a5473e8</a:value>
</KeyValuePairOfstringanyType>
<KeyValuePairOfstringanyType>
<a:key>ApiDepthKey</a:key>
<a:value i:type="b:int" xmlns:b="www.w3.org/.../XMLSchema">1</a:value>
</KeyValuePairOfstringanyType>
<KeyValuePairOfstringanyType>
<a:key>ApiActivityIdKey</a:key>
<a:value i:type="b:guid" xmlns:b="schemas.microsoft.com/.../Serialization">d27876be-8193-4576-b2e0-9ce7913943b7</a:value>
</KeyValuePairOfstringanyType>
<KeyValuePairOfstringanyType>
<a:key>ApiPluginSolutionNameKey</a:key>
<a:value i:type="b:string" xmlns:b="www.w3.org/.../XMLSchema">System</a:value>
</KeyValuePairOfstringanyType>
<KeyValuePairOfstringanyType>
<a:key>ApiStepSolutionNameKey</a:key>
<a:value i:type="b:string" xmlns:b="www.w3.org/.../XMLSchema">System</a:value>
</KeyValuePairOfstringanyType>
</ErrorDetails>
<Message>This plugin assembly uses version 4.6.1 of the .NET Framework. At this time Microsoft Dynamics 365 requires version 4.5.2 of the .NET Framework for plugin assemblies. Rebuild this assembly using .NET Framework version 4.5.2 and try again.</Message>
<Timestamp>2018-09-13T18:07:53.9931963Z</Timestamp>
<ExceptionRetriable>false</ExceptionRetriable>
<ExceptionSource i:nil="true" />
<InnerFault>
<ActivityId>d27876be-8193-4576-b2e0-9ce7913943b7</ActivityId>
<ErrorCode>-2147204597</ErrorCode>
<ErrorDetails xmlns:a="schemas.datacontract.org/.../System.Collections.Generic" />
<Message>This plugin assembly uses version 4.6.1 of the .NET Framework. At this time Microsoft Dynamics 365 requires version 4.5.2 of the .NET Framework for plugin assemblies. Rebuild this assembly using .NET Framework version 4.5.2 and try again.</Message>
<Timestamp>2018-09-13T18:07:53.9931963Z</Timestamp>
<ExceptionRetriable>false</ExceptionRetriable>
<ExceptionSource i:nil="true" />
<InnerFault i:nil="true" />
<OriginalException i:nil="true" />
<TraceText i:nil="true" />
</InnerFault>
<OriginalException i:nil="true" />
<TraceText i:nil="true" />
</OrganizationServiceFault>

Server stack trace:
at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc& rpc)
at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)

Exception rethrown at [0]:
at Microsoft.Crm.Tools.Libraries.RegistrationHelper.RegisterAssembly(CrmOrganization org, String pathToAssembly, CrmPluginAssembly assembly)
at Microsoft.Crm.Tools.AssemblyRegistration.PluginRegistrationViewModel.btnregisterClick()

Any help will be appreciated.
Thanks

*This post is locked for comments

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Getting Error on Registering a Plugin

    Solved the problem. Thanks for all the responses.

  • gdas Profile Picture
    gdas 50,085 on at
    RE: Getting Error on Registering a Plugin

    Please close the thread.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Getting Error on Registering a Plugin

    Hi Rabbal,

    But if you were using a Sys Admin account, it should have had all the permissions automatically right ?

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Getting Error on Registering a Plugin

    Fixed it, didn't have permission for creating plugin

  • Verified answer
    gdas Profile Picture
    gdas 50,085 on at
    RE: Getting Error on Registering a Plugin

    Login with different System Administrator user and make sure you clean the solution and build again the dll in .net framework 4.5.2.

  • Verified answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Getting Error on Registering a Plugin

    Did you try registering from another System admin account in addition to using 4.5.2 to make sure it is not the account that's causing the issue ?

    And also, can you compare if the Guid of the account you are using matches the one from the error (Principal user (Id=5d7d81a2-47b1-e811-a98b-000d3a1a7fa7)

    Thanks,

    Akhil

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Getting Error on Registering a Plugin

    Yes, I tried with both.     I.m doing it with 4.5.2  and getting it

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Getting Error on Registering a Plugin

    Yes, I did but still getting the same error.

  • Suggested answer
    gdas Profile Picture
    gdas 50,085 on at
    RE: Getting Error on Registering a Plugin

    Error also says that - This plugin assembly uses version 4.6.1 of the .NET Framework. At this time Microsoft Dynamics 365 requires version 4.5.2 of the .NET Framework for plugin assemblies. Rebuild this assembly using .NET Framework version 4.5.2 and try again.

    Did you tried with rebuild in .net framework 4.5.2?

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Getting Error on Registering a Plugin

    Yeah, I'm using the admin account for registering the plugin. Still getting the issue.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans