web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Service | Customer Service, Contact Center, Fie...
Unanswered

Error on Publishing AppModule enity changes

(0) ShareShare
ReportReport
Posted on by

Hi Team,

I am facing error while I am trying to publish the changes of AppModule entity at runtime. Any leads would be helpful. Thanks in advance.

Error:

Activity failing with unmonitored exception: Microsoft.Crm.CrmException: Fatal error occured while executing UpdateAppModuleEventHandlerPlugin. Object reference not set to an instance of an object.
at Microsoft.Crm.Sandbox.SandboxCodeUnit.ProcessException(Exception originalException, IExecutionContext context, SandboxClient client, SandboxCallTracker callTracker, Boolean isSafeToRetry, DateTime performanceExecutionStartTime, SandboxTracker tracker, Guid parentExecutionId, CrmException& crmException, String& assemblyContents)
at Microsoft.Crm.Sandbox.SandboxCodeUnit.<>c__DisplayClass26_0.<Execute>b__0()
at Microsoft.PowerApps.CoreFramework.ActivityLoggerExtensions.Execute(ILogger logger, EventId eventId, ActivityType activityType, Action action, IEnumerable`1 additionalCustomProperties)
at Microsoft.Xrm.Telemetry.XrmTelemetryExtensions.Execute(ILogger logger, XrmTelemetryActivityType activityType, Action action)
at Microsoft.Xrm.RemotePlugin.CrmProvider.RemotePlugin.CDSExecute(IServiceProvider serviceProvider)
at Microsoft.Crm.Extensibility.V5PluginProxyStep.ExecuteInternal(PipelineExecutionContext context)
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.<>c__DisplayClass3_0.<RunStep>b__0()
at Microsoft.PowerApps.CoreFramework.ActivityLoggerExtensions.Execute(ILogger logger, EventId eventId, ActivityType activityType, Action action, IEnumerable`1 additionalCustomProperties)
at Microsoft.Xrm.Telemetry.XrmTelemetryExtensions.Execute(ILogger logger, XrmTelemetryActivityType activityType, Action action)
at Microsoft.Crm.Extensibility.Pipeline.Execute(PipelineExecutionContext context)
at Microsoft.Crm.Extensibility.PipelineInstrumentationHelper.Execute(Boolean instrumentationEnabled, String stopwatchName, ExecuteWithInstrumentation action, PipelineExecutionContext context)
at Microsoft.Crm.Extensibility.MessageProcessor.Execute(PipelineExecutionContext context)
at Microsoft.Crm.Extensibility.InternalMessageDispatcher.Execute(PipelineExecutionContext context)
at Microsoft.Crm.Extensibility.ExtensiblePlatformMessageDispatcher.Execute(PipelineExecutionContext pluginContext)
at Microsoft.Crm.Extensibility.ExtensiblePlatformMessageDispatcher.CreateWithInvocationSource(BusinessEntity entity, Int32 invocationSource, ExecutionContext context)
at Microsoft.Crm.BusinessEntities.BusinessProcessObject.<>c__DisplayClass223_0.<Create>b__0()
at Microsoft.PowerApps.CoreFramework.ActivityLoggerExtensions.Execute[TResult](ILogger logger, EventId eventId, ActivityType activityType, Func`1 func, IEnumerable`1 additionalCustomProperties)
Web Service Plug-in failed in SdkMessageProcessingStepId: 5dcbbb1b-ea3e-db11-86a7-000a3a5473e8; EntityName: none; Stage: 30; MessageName: Publish; AssemblyName: Microsoft.Crm.Extensibility.InternalOperationPlugin, Microsoft.Crm.ObjectModel, Version=9.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35; ClassName: Microsoft.Crm.Extensibility.InternalOperationPlugin; Exception: Unhandled exception:
Exception type: Microsoft.Crm.CrmException
Message: Attempted to perform an unauthorized operation.
at Microsoft.Crm.ObjectModel.AppModuleService.PublishAppModule(Guid appModuleId, ExecutionContext context)
at Microsoft.Crm.ObjectModel.AppModulePublisher.Publish(Dictionary`2 publishableObjects)
at Microsoft.Crm.ObjectModel.SqlAppLockUtility.<>c__DisplayClass1_0.<ExecuteInTransactionWithAppLock>b__0()
at Microsoft.Crm.ObjectModel.CustomizationSqlLockManager.InternalAcquireOrExecuteInLock(CustomizationLockType customizationType, CrmException exceptionToThrow, Action action)
at Microsoft.Crm.ObjectModel.SqlAppLockUtility.ExecuteInTransactionWithAppLock(CustomizationLockType lockType, ExecutionContext context, Action action, ProcessDependenciesOption processDependenciesOption, FlushCacheOption flushCacheOption)
at Microsoft.Crm.ObjectModel.PublishXml.<>c__DisplayClass30_1.<PublishInternal>b__1()
at Microsoft.PowerApps.CoreFramework.ActivityLoggerExtensions.Execute(ILogger logger, EventId eventId, ActivityType activityType, Action action, IEnumerable`1 additionalCustomProperties)
at Microsoft.Xrm.Telemetry.XrmTelemetryExtensions.Execute(ILogger logger, XrmTelemetryActivityType activityType, Action action)
at Microsoft.Crm.ObjectModel.PublishXml.PublishInternal(String objectsString, Boolean flushCache, ExecutionContext context)
at Microsoft.PowerApps.CoreFramework.ActivityLoggerExtensions.Execute(ILogger logger, EventId eventId, ActivityType activityType, Action action, IEnumerable`1 additionalCustomProperties)
at Microsoft.Xrm.Telemetry.XrmTelemetryExtensions.Execute(ILogger logger, XrmTelemetryActivityType activityType, Action action)
at Microsoft.Crm.ObjectModel.SolutionHistoryDataService.ExecuteWithSolutionHistory(SolutionHistoryOperation operation, IExecutionContext context, Action action, Boolean checkForSolutionContext, IBusinessEntity solutionHistoryData)
at Microsoft.Crm.ObjectModel.PublishXml.Publish(String objectsString, Boolean flushCache, ExecutionContext context)
at Microsoft.Crm.WebServices.PublishXmlService.PublishHelper(String entities, ExecutionContext context)
at Microsoft.Crm.WebServices.PublishXmlService.Publish(String entities, ExecutionContext context)
-- End stack trace --

Exception type: System.Reflection.TargetInvocationException
Message: Exception has been thrown by the target of an invocation.
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.Web.Services.Protocols.LogicalMethodInfo.Invoke(Object target, Object[] values)
at Microsoft.Crm.Extensibility.InternalOperationPlugin.Execute(IServiceProvider serviceProvider)
at Microsoft.Crm.Extensibility.V5PluginProxyStep.ExecuteInternal(PipelineExecutionContext context)
at Microsoft.Crm.Extensibility.VersionedPluginProxyStepBase.Execute(PipelineExecutionContext context)
-- End stack trace --

.
AppModuleService.PublishAppModule(): User does not have Microsoft.Xrm.PrivilegeDefinition Privilege.
I gave following privileges to my new role:
<RolePrivilege name="prvReadCustomization" level="Global" />
    <RolePrivilege name="prvReadQuery" level="Global" />
    <RolePrivilege name="prvReadSavedQueryVisualizations" level="Global" />
    <RolePrivilege name="prvReadSystemForm" level="Global" />
    <RolePrivilege name="prvWriteQuery" level="Global" />
    <RolePrivilege name="prvWriteCustomization" level="Global" />
    <RolePrivilege name="prvWriteEntity" level="Global" />
    <RolePrivilege name="prvWriteAttribute" level="Global" />
    <RolePrivilege name="prvWriteRelationship" level="Global" />
    <RolePrivilege name="prvWriteAppModule" level="Global" />
    <RolePrivilege name="prvReadAppModule" level="Global" />
    <RolePrivilege name="prvAppendUser" level="Global" />
    <RolePrivilege name="prvAssignRole" level="Global" />
    <RolePrivilege name="prvWritemsdyn_channelprovider" level="Global" />
    <RolePrivilege name="prvReadmsdyn_channelprovider" level="Global" />
    <RolePrivilege name="prvDeletemsdyn_channelprovider" level="Global" />
    <RolePrivilege name="prvCreatemsdyn_channelprovider" level="Global" />
    <RolePrivilege name="prvAppendmsdyn_appconfiguration" level="Global" />
    <RolePrivilege name="prvAppendmsdyn_applicationextension" level="Global" />
    <RolePrivilege name="prvAppendmsdyn_applicationtabtemplate" level="Global" />
    <RolePrivilege name="prvAppendmsdyn_notificationfield" level="Global" />
    <RolePrivilege name="prvAppendmsdyn_notificationtemplate" level="Global" />
    <RolePrivilege name="prvAppendmsdyn_sessiontemplate" level="Global" />
    <RolePrivilege name="prvAppendmsdyn_templateparameter" level="Global" />
    <RolePrivilege name="prvAppendTomsdyn_appconfiguration" level="Global" />
    <RolePrivilege name="prvAppendTomsdyn_applicationextension" level="Global" />
    <RolePrivilege name="prvAppendTomsdyn_applicationtabtemplate" level="Global" />
    <RolePrivilege name="prvAppendTomsdyn_notificationfield" level="Global" />
    <RolePrivilege name="prvAppendTomsdyn_notificationtemplate" level="Global" />
    <RolePrivilege name="prvAppendTomsdyn_sessiontemplate" level="Global" />
    <RolePrivilege name="prvAppendTomsdyn_templateparameter" level="Global" />
    <RolePrivilege name="prvCreatemsdyn_appconfiguration" level="Global" />
    <RolePrivilege name="prvCreatemsdyn_applicationextension" level="Global" />
    <RolePrivilege name="prvCreatemsdyn_applicationtabtemplate" level="Global" />
    <RolePrivilege name="prvCreatemsdyn_notificationfield" level="Global" />
    <RolePrivilege name="prvCreatemsdyn_notificationtemplate" level="Global" />
    <RolePrivilege name="prvCreatemsdyn_sessiontemplate" level="Global" />
    <RolePrivilege name="prvCreatemsdyn_templateparameter" level="Global" />
    <RolePrivilege name="prvDeletemsdyn_appconfiguration" level="Global" />
    <RolePrivilege name="prvDeletemsdyn_applicationextension" level="Global" />
    <RolePrivilege name="prvDeletemsdyn_applicationtabtemplate" level="Global" />
    <RolePrivilege name="prvDeletemsdyn_notificationfield" level="Global" />
    <RolePrivilege name="prvDeletemsdyn_notificationtemplate" level="Global" />
    <RolePrivilege name="prvDeletemsdyn_sessiontemplate" level="Global" />
    <RolePrivilege name="prvDeletemsdyn_templateparameter" level="Global" />
    <RolePrivilege name="prvReadmsdyn_appconfiguration" level="Global" />
    <RolePrivilege name="prvReadmsdyn_applicationextension" level="Global" />
    <RolePrivilege name="prvReadmsdyn_applicationtabtemplate" level="Global" />
    <RolePrivilege name="prvReadmsdyn_notificationfield" level="Global" />
    <RolePrivilege name="prvReadmsdyn_notificationtemplate" level="Global" />
    <RolePrivilege name="prvReadmsdyn_sessiontemplate" level="Global" />
    <RolePrivilege name="prvReadmsdyn_templateparameter" level="Global" />
    <RolePrivilege name="prvReadRole" level="Global" />
    <RolePrivilege name="prvReadUser" level="Global" />
    <RolePrivilege name="prvWritemsdyn_appconfiguration" level="Global" />
    <RolePrivilege name="prvWritemsdyn_applicationextension" level="Global" />
    <RolePrivilege name="prvWritemsdyn_applicationtabtemplate" level="Global" />
    <RolePrivilege name="prvWritemsdyn_notificationfield" level="Global" />
    <RolePrivilege name="prvWritemsdyn_notificationtemplate" level="Global" />
    <RolePrivilege name="prvWritemsdyn_sessiontemplate" level="Global" />
    <RolePrivilege name="prvWritemsdyn_templateparameter" level="Global" />
I have the same question (0)
  • Sanjana Ramesh Profile Picture
    on at

    Hi Anjali,

    Have you tried publishing the AppModule with system admin creds?

    Regards,

    Sanjana

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

News and Announcements

Season of Giving Solutions is Here!

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Service | Customer Service, Contact Center, Field Service, Guides

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 24 Super User 2025 Season 2

#2
TAHER Mehdi Profile Picture

TAHER Mehdi 14

#3
Fameeda Yaseen Profile Picture

Fameeda Yaseen 10

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans