I see you selected "current version" as the version tag, which used to be used for D365FO before it got a dedicated forum. Do you mean D365FO (I'll move your question to the right forum) or AX 2012?
I guess it's AX 2012 and you don't get any details about the exception because you don't catch CLRError exceptions anywhere. Please do it - knowing what problem you have will be a huge step forward.
By the way, please used the </> button in the rich formatting view to paste source code. It makes code easier to read.