Getting attributes in X++

In X++, you can decorate classes and methods with attributes. Attributes were added in AX 2012 (I believe), where the typical use case was a definition of data contracts. They’re much more common in F&O, because they’re also used for CoC and event handlers. For most developers, attributes are something defined by Microsoft and used …

Continue reading ‘Getting attributes in X++’ »

Find assembly for a given type – in AX 7

Five years ago, I wrote a blog post called Assembly containing a given type, demonstrating how to find the assembly where a given type is defined. I needed the same thing in AX 7, but instead of using the same code, I decided to utilize the fact that I can now easily write parts of …

Continue reading ‘Find assembly for a given type – in AX 7’ »

Sestavení obsahující zadaný typ

Při zkoumání Dynamics AX 2012 občas narážím na situace, kdy bych se chtěl dozvědět více o nějakém CLR typu (zejména dekompilovat ho v ILSpy) a potřebuji vědět, v jakém sestavení je se nachází. Lze to řešit například takovouto X++ metodou: public static void showContainingAssembly(str _typeName) { System.AppDomain appDomain = System.AppDomain::get_CurrentDomain(); System.Reflection.Assembly[] assemblies = appDomain.GetAssemblies(); System.Reflection.Assembly …

Continue reading ‘Sestavení obsahující zadaný typ’ »

Assembly containing a given type

When exploring Dynamics AX 2012, I sometimes meet situations when I would like to know more about some CLR type (particularly to decompile it in ILSpy) and I need to know in which assembly it is contained. It can be solved by the following X++ method, for instance: public static void showContainingAssembly(str _typeName) { System.AppDomain …

Continue reading ‘Assembly containing a given type’ »