Skip to main content

Notifications

Announcements

No record found.

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

Assertion failed: Attempted to emit a ret instruction with an incorrect number of elements on the stack

Posted on by 5

When I full compile the module, I got this problem which located in  C:\AOSService\PackagesLocalDirectory\ApplicationSuite\Foundation\AxClass\BudgetDimensionFocusInitializeBalance.xml.

I have restarted the computer and closed all VS instance instead of this one. When I sync and compile the module without the references, there is nothing wrong but can't create the depolyment package either.

Abnormal termination with unhandled exception. Exception key: 887f4a01-28ed-4366-a620-3d945d521312. Microsoft.Dynamics.AX.Metadata.XppCompiler.AssertionFailedException: Assertion failed: Attempted to emit a ret instruction with an incorrect number of elements on the stack: 2   at Microsoft.Dynamics.AX.Metadata.XppCompiler.AssertHelper.Panic[T](String failDescription, Object[] args)   at Microsoft.Dynamics.AX.Metadata.XppCompiler.AssertHelper.Requires(Boolean requirement, String failDescription)   at Microsoft.Dynamics.AX.Framework.Xlnt.ILGenerator.ILGeneratorSweeper.VisitMethod(Object payload, Method method)   at Microsoft.Dynamics.AX.Metadata.XppCompiler.AstVisitor`2.VisitMethodOrDelegate(TPayload payload, MethodOrDelegate methodOrDelegate)   at Microsoft.Dynamics.AX.Metadata.XppCompiler.AstVisitorWithDiagnostics`2.VisitMethodOrDelegate(TPayload payload, MethodOrDelegate methodOrDelegate)   at Microsoft.Dynamics.AX.Framework.Xlnt.ILGenerator.ILGeneratorSweeper.VisitMethodOrDelegate(Object payload, MethodOrDelegate methodOrDelegate)   at Microsoft.Dynamics.AX.Metadata.XppCompiler.AstVisitor`2.VisitMethods(TPayload payload, IEnumerable`1 methodOrDelegates)   at Microsoft.Dynamics.AX.Framework.Xlnt.ILGenerator.ILGeneratorSweeper.VisitMethods(Object payload, IEnumerable`1 methods)   at Microsoft.Dynamics.AX.Metadata.XppCompiler.AstVisitor`2.VisitMethods(TPayload payload, IDictionary`2 dictionary)   at Microsoft.Dynamics.AX.Framework.Xlnt.ILGenerator.ILGeneratorSweeper.VisitClass(Object payload, Class classInstance)   at Microsoft.Dynamics.AX.Metadata.XppCompiler.AstVisitor`2.VisitClassOrInterface(TPayload payload, ClassOrInterface classOrInterface)   at Microsoft.Dynamics.AX.Metadata.XppCompiler.AstVisitorWithDiagnostics`2.VisitClassOrInterface(TPayload payload, ClassOrInterface classOrInterface)   at Microsoft.Dynamics.AX.Metadata.XppCompiler.AstVisitor`2.VisitModelElement(TPayload payload, ModelElement modelElement)   at Microsoft.Dynamics.AX.Framework.Xlnt.ILGenerator.ILGeneratorSweeper.VisitModelElement(Object payload, ModelElement modelElement)   at Microsoft.Dynamics.AX.Metadata.XppCompiler.AstVisitor`2.VisitCompilationUnit(TPayload payload, CompilationUnit compilationUnit)   at Microsoft.Dynamics.AX.Metadata.XppCompiler.AstVisitorWithDiagnostics`2.VisitCompilationUnit(TPayload payload, CompilationUnit compilationUnit)   at Microsoft.Dynamics.AX.Framework.Xlnt.ILGenerator.ILGeneratorPass3Worker.GenerateBodiesInNetmodule(Parameters generatorparameters, String netmoduleName, IXppcMetadataProvider metadataProvider, IDiagnosticSink diagnosticsHandler, NetModuleNameByTypeName netModules, ICrossReferenceProvider xRefProvider)   at Microsoft.Dynamics.AX.Framework.Xlnt.ILGenerator.ILGeneratorPass3Worker.GenerateBodiesInNetmodule(Parameters parameters, String netmoduleName, IXppcMetadataProvider metadataProvider, NetModuleNameByTypeName netModules, FileRollbackHandler fileRollbackHandler, IDiagnosticSink diagnosticsHandler, ICrossReferenceProvider xRefProvider)   at Microsoft.Dynamics.AX.Framework.Xlnt.ILGenerator.ILGeneratorPass3Worker.InvokeInNetmodule(Parameters parameters, String netmoduleName, IXppcMetadataProvider metadataProvider, NetModuleNameByTypeName netModules, FileRollbackHandler fileRollbackHandler, IDiagnosticSink diagnosticsHandler, ICrossReferenceProvider xRefProvider)   at Microsoft.Dynamics.AX.Framework.Xlnt.ILGenerator.ILGeneratorMain.<>c__DisplayClass8_3.<GenerateILImplementation>b__4(String moduleName)   at Microsoft.Dynamics.AX.Metadata.XppCompiler.ParallelCrashDumpUtil.<>c__DisplayClass1_0`1.<ForEach>b__2(T t)   at System.Threading.Tasks.Parallel.<>c__DisplayClass17_0`1.<ForWorker>b__1()   at System.Threading.Tasks.Task.InnerInvokeWithArg(Task childTask)   at System.Threading.Tasks.Task.<>c__DisplayClass176_0.<ExecuteSelfReplicating>b__0(Object ).

  • Zoe Deng Profile Picture
    Zoe Deng 5 on at
    RE: Assertion failed: Attempted to emit a ret instruction with an incorrect number of elements on the stack

    It's D365 version

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

Product updates

Dynamics 365 release plans