Skip to main content

Notifications

Finance | Project Operations, Human Resources, ...
Unanswered

Event handler initializer exception when deploying software deploy package to T1 environment

(1) ShareShare
ReportReport
Posted on by 8
Hi all,

  I have a question regarding an error that we are receiving when trying to deploy a software deployable package on a particular environment.

  We have two Tier 1 environments called Gold and Test.  Both environments are on 10.0.34 PU58.  Whenever we try to apply a software deployable package on Test via a release pipeline, we are getting the error below in MyCustomModel during database sync.
 
Inner Exception: An exception was encountered while initializing event handler initializer 'InitMethod' on type 'Dynamics.AX.Application.EventHandler.EventHandlersInitializeClass, Dynamics.AX.MyCustomModel, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'.
Inner Exception: System.IO.FileNotFoundException: Could not load file or assembly 'Dynamics.AX.MyCustomModel.0.netmodule' or one of its dependencies. The system cannot find the file specified.
File name: 'Dynamics.AX.MyCustomModel.0.netmodule' --- System.IO.FileNotFoundException: The system cannot find the file specified. (Exception from HRESULT: 0x80070002)
   at Dynamics.AX.Application.EventHandler.EventHandlersInitializeClass.InitMethod()
   at Microsoft.Dynamics.Ax.Xpp.ReflectionCallHelper.  c. InitializeMetadataEventHandler b__87_0(MethodInfo eventHandler) in MyPath - cmd - b - Source - Kernel - xppil - XppSupport - ReflectionCallHelper.cs:line 965
 
 
  I want to point out the following observations:
 
1) We never get any such errors when we try to build and synchronize on our local DEV boxes.  Compilation and database synchronization is always successful on our dev boxes.  The dev boxes are on the same application and platform release as the Test environment.
 
2) If we try to resume the failing deployment, we keep getting the error.
 
3) On two occasions, the deployment succeeded when we aborted the failing deployment and started a new deployment via LCS using the exact package (see 2 screenshots at the end).
 
4) If we do a deployment using the exact package on Gold environment via LCS, the deployment succeeds.
 
5) We have once had a deployment succeed first time to Test via the release pipeline by first RDPing to Test, deleting the custom packages in PackagesLocalDirectory and then starting the release pipeline.

Has anyone ever come across such an issue before?  It seems strange that we get no error whatsoever for MyCustomModel when building and synchronizing on our dev boxes but then get this strange error when trying to deploy via release pipeline.
 
//
 
//
 
---------------------------------
 
@Martin Drab Apologies but I can't seem to reply to your post, don't have the option to reply for some reason or another.
  • André Arnaud de Calavon Profile Picture
    André Arnaud de Cal... 291,979 Super User 2025 Season 1 on at
    Event handler initializer exception when deploying software deploy package to T1 environment
    Hi Antonio,
     
    Have you checked the details of the package if the files are indeed in it? In case the deployment succeeded after abortion, was the software really updated? I have seen issues where indeed an actual file was missing in the deployable package, but not where it fails and gets deployed after an abortion.
  • Antonio A Profile Picture
    Antonio A 8 on at
    Event handler initializer exception when deploying software deploy package to T1 environment
    @Andre Arnaud
     
    Hi Andre,
     
      The model that is giving me the error is the model that I am trying to deploy, amongst a list of other models.
  • André Arnaud de Calavon Profile Picture
    André Arnaud de Cal... 291,979 Super User 2025 Season 1 on at
    Event handler initializer exception when deploying software deploy package to T1 environment
    Hi Antonio,
     
    Is the name of the model you try to deploy the same as the one is giving the error? Or this is the model mentioned in the error referenced by the model you want to deploy?
  • Rich Profile Picture
    Rich 273 on at
    Event handler initializer exception when deploying software deploy package to T1 environment
    Colleague & I are both having issues with the input form, tying to put error text in as text rather than screenshot, by removing chevrons (aka angle brackets) and path separators (replaced with hyphens)
     
    Inner Exception: An exception was encountered while initializing event handler initializer 'InitMethod' on type 'Dynamics.AX.Application.EventHandler.EventHandlersInitializeClass, Dynamics.AX.MyCustomModel, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'.
    Inner Exception: System.IO.FileNotFoundException: Could not load file or assembly 'Dynamics.AX.MyCustomModel.0.netmodule' or one of its dependencies. The system cannot find the file specified.
    File name: 'Dynamics.AX.MyCustomModel.0.netmodule' --- System.IO.FileNotFoundException: The system cannot find the file specified. (Exception from HRESULT: 0x80070002)
       at Dynamics.AX.Application.EventHandler.EventHandlersInitializeClass.InitMethod()
       at Microsoft.Dynamics.Ax.Xpp.ReflectionCallHelper.  c. InitializeMetadataEventHandler b__87_0(MethodInfo eventHandler) in MyPath - cmd - b - Source - Kernel - xppil - XppSupport - ReflectionCallHelper.cs:line 965

     
  • Martin Dráb Profile Picture
    Martin Dráb 230,848 Most Valuable Professional on at
    Event handler initializer exception when deploying software deploy package to T1 environment
    Unfortunately I don't see the error.

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

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,979 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 230,848 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans