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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Error deploying package in Test environment during DB synchronization

(0) ShareShare
ReportReport
Posted on by 685

Hi everyone.

We have made a new project/model; once finished, we have compiled and generated deployable package (in a Azure hosted environment). But, when deploying this package in a Test environment (Azure hosted) via LCS, fails during sinchronization:

There are one or more failed step during the runbook execution, please check the runbook xml and log for more detail

The step 15 failed with the following error:
The step started
11/17/2017 05:58:54: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> Microsoft.Dynamics.Ax.Xpp.EventHandlerInitializationException: An exception was encountered while initializing event handler initializer 'InitMethod' on type 'Dynamics.AX.Application.ChainOfCommand.ChainOfCommandInitializeClass, Dynamics.AX.ExcLocEcuadorExtension, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'. ---> System.TypeLoadException: Could not load type 'AssetPostCoCHelper' from assembly 'Dynamics.AX.ApplicationSuite, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'.    at Dynamics.AX.Application.ChainOfCommand.ChainOfCommandInitializeClass.InitMethod()    --- End of inner exception stack trace ---    at Microsoft.Dynamics.Ax.Xpp.ReflectionCallHelper.<>c.<InitializeMetadataChainOfCommand>b__57_0(MethodInfo eventHandler)    at Microsoft.Dynamics.Ax.Xpp.ReflectionCallHelper.InitializeMetadataChainOfCommand()    --- End of inner exception stack trace ---    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 Microsoft.Dynamics.AX.AOS.StartupInternal(String[] Arguments)    at Microsoft.Dynamics.AX.AOS.Startup()    at Microsoft.Dynamics.AX.AosConfig.?A0x8ae735a4.GetAosConfig()    at Microsoft.Dynamics.AX.AosConfig.Config.InitInternal(Boolean isOfflineMode)    at Microsoft.Dynamics.AX.Framework.Database.Tools.LegacyCodepath.StartAosCode(SyncOptions syncOptions, String sqlConnectionString)    at Microsoft.Dynamics.AX.Framework.Database.Tools.LegacyCodepath.ExecuteWithinAOS(SyncOptions syncOptions, String sqlConnectionString, IMetadataProvider metadataProvider, Func`1 func, Action`1 errorHandler)    at Microsoft.Dynamics.AX.Framework.Database.Tools.LegacyCodepath.RunCustomAction(SyncOptions syncOptions, String sqlConnectionString, IMetadataProvider metadataProvider, Action`1 a)    at Microsoft.Dynamics.AX.Framework.Database.Tools.SyncEngine.PreTableSync()    at Microsoft.Dynamics.AX.Framework.Database.Tools.SyncEngine.FullSync()    at Microsoft.Dynamics.AX.Framework.Database.Tools.SyncEngine.RunSync(SyncOptions options)    at Microsoft.Dynamics.AX.Framework.Database.Tools.SyncEngine.Run(String metadataDirectory, String sqlConnectionString, SyncOptions options) 11/17/2017 05:58:54:     Inner Exception: An exception was encountered while initializing event handler initializer 'InitMethod' on type 'Dynamics.AX.Application.ChainOfCommand.ChainOfCommandInitializeClass, Dynamics.AX.ExcLocEcuadorExtension, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'. 11/17/2017 05:58:54:     Inner Exception: System.TypeLoadException: Could not load type 'AssetPostCoCHelper' from assembly 'Dynamics.AX.ApplicationSuite, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'.    at Dynamics.AX.Application.ChainOfCommand.ChainOfCommandInitializeClass.InitMethod() 11/17/2017 05:58:54: The operation failed.
The step failed
   at Microsoft.Dynamics.AX.AXUpdateInstallerBase.AXUpdateInstallerBase.executeParallel(String runbookID, Boolean silent, String updatePackageFilePath, IRunbookExecutor runbookExecutor, Boolean versionCheck, Parameters param)
   at Microsoft.Dynamics.AX.AXUpdateInstaller.Program.InstallUpdate(String[] args)
   at Microsoft.Dynamics.AX.AXUpdateInstaller.Program.Main(String[] args)

This is the step in the RunBook:

<ID>15</ID>
      <RunbookID>6cff2a40-9996-4473-bdc4-9148e20f907d</RunbookID>
      <PackageId>1da3dd5a-f9a5-4164-8c49-1a2a46b40865</PackageId>
      <PackageType>ApplicationPackage</PackageType>
      <CompletedManually>false</CompletedManually>
      <Description>GlobalUpdate script for service model: AOSService on machine: XXX-XXX-XXX</Description>
      <MachineName>XXX-XXX-XXX-1</MachineName>
      <ServiceModelName>AOSService</ServiceModelName>
      <ScriptToExecute>
        <FileName>AutoDeployReportAndSyncDB.ps1</FileName>
        <Automated>true</Automated>
        <Description>Sync AX database</Description>
        <RetryCount>0</RetryCount>
        <InvokeWithPowershellProcess>false</InvokeWithPowershellProcess>
        <DynamicStepDefinition />
      </ScriptToExecute>
      <StartTime>2017-11-17T05:57:56.9666586+01:00</StartTime>
      <EndTime>2017-11-17T05:58:57.1060636+01:00</EndTime>
      <StepState>Failed</StepState>
      <DependentStepIDList>
        <string>14</string>
      </DependentStepIDList>
      <StepType>GlobalUpdate</StepType>

The deployed package is an Extension that makes use of Chain of Command feature, available since Platform Update 9. Curiously, the first class that makes extension in project is AssetPost.
The source DEV environment and target TEST environment are the same version:

Microsoft Dynamics 365 for Finance and Operations, Enterprise edition (July 2017)

Update9 (7.0.4612.35162)

 

Any hints?

PS: There is a similar unsolved question in community.dynamics.com/.../224767

*This post is locked for comments

I have the same question (0)
  • Martin Dráb Profile Picture
    237,803 Most Valuable Professional on at

    The package you're extending must be rebuilt on PU9, otherwise CoC can't be used for it. Have you done it in TEST?

  • Raúl Llorente Peña Profile Picture
    685 on at

    Martin, both DEV and TEST are same version:

    Microsoft Dynamics 365 for Finance and Operations, Enterprise edition (July 2017)

    Update9 (7.0.4612.35162)

    TEST is a sandbox environment (it's not ours, it belongs to a customer), and package is deployed via LCS. Being this package a DLL (as I understand), does it make sense to compile it without source code?

    And I am told that MS cares in compiling and sinchronizing this environment, so users cannot do the same in these sandboxes (I have some doubt in this).

  • Verified answer
    Martin Dráb Profile Picture
    237,803 Most Valuable Professional on at

    I'm not saying that they're on not the same version, I'm saying that code must be compiled on PU9 if you want to extend it with CoC. If it's not and you're deploying binaries, your deployable packages must include updated binaries for the package you're extending. Please search for previous discussions about CoC, it's a common problem. It will be resolved when we get a new application release, where all code will be compiled as needed.

    You're right in saying that deployable packages don't contain source code, and that's why the other statement (that MS is compiling the environment) is wrong. No compilation is needed (or possible) on deployment, that happens only during development and on build.

  • Raúl Llorente Peña Profile Picture
    685 on at

    Hmmm.... I've searched about this and stumbled again into

    [View:https://docs.microsoft.com/en-us/dynamics365/unified-operations/dev-itpro/extensibility/method-wrapping-coc:750:50]

    The functionality that is described in this topic (CoC and access to protected methods and variables) is available in Microsoft Dynamics 365 Unified Operations Platform update 9. However, the class that is being augmented must also be compiled on Platform update 9 or later. As of August 2017, all current releases of the applications for Microsoft Dynamics 365 for Finance and Operations, Enterprise edition, have been compiled on Platform update 8 or earlier. Therefore, to wrap a method that is defined in a base package (such as Application Suite), you must recompile that base package on Platform update 9 or later. As an example: If you create your own extension model that is augmenting a class that exists in the Application Suite model, and if you are using CoC or accessing protected methods/variables, you will need to build both Application Suite and your extension model. You will also need to create a deployable package that includes both models in order to deploy this functionality on a runtime environment. This is a temporary situation until the next release of the Microsoft Dynamics 365 for Finance and Operations application.

    In other words, due to the fact that in a Test or Prod environment with PU9 have P8 builds, we should provide a package containing our extension, PLUS the Application Suite (and possibly other packages).... am I right?

  • Martin Dráb Profile Picture
    237,803 Most Valuable Professional on at

    Yes, that what I said ("your deployable packages must include updated binaries for the package you're extending"). It it's Application Suite package that you're extending with CoC, then yes, you must include Application Suite.

  • Johnny Profile Picture
    6,478 on at

    Hello Martin,

    I'm having similar problem when I try to do a Synchronization on my DevBox, which is Platform Update 12.

    I've created Extension class of SalesInvoiceDP and I'm using CoC on one of its public method.

    I did the full build, which completed successfully, but when I try to Synch the database I'm having the error stated above.

    Shouldn't this error gone when I did full build and I'm just Synchronizing the db of my DevBox?

    One more question: Our test environments are also Update 12. Should we still include "Application suite" package in deployable packages?

    Thanks.

  • Martin Dráb Profile Picture
    237,803 Most Valuable Professional on at

    Regarding the last question: yes, you have to. We're talking about building and deploying application code, not platform code. Installing PU12 doesn't touch Application Suite. This step won't be needed when you get a newer application version, not the platform.

    Regarding the problem with synchronization, yes, it should work. Just to be sure, try rebuilding Application Suite (alone), make sure the build succeeded, restart web server and try it once more.

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

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 > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans