开发者

Why are no CLR exceptions being reported in Dynamics AX?

When an exception ocurrs in my .NET code, the X++ code just stops executing and drops out. It doesn't displa开发者_如何学Cy any error message at all, it simply stops working.

Why is this? Is there a way to change it?


Here's one way to solve that:

System.Exception                        e; // declare

;

try
{
       ... code that can throw clr error
}
catch (Exception::CLRError)
{
       e = CLRInterop::getLastException();

       while( e )
       {
           info( e.get_Message() );
           e = e.get_InnerException();
       }
}

Also read more here: http://blogs.msdn.com/b/emeadaxsupport/archive/2010/07/22/working-with-clr-exceptions-in-dynamics-ax-x-code.aspx

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜