Miklix

Error "No metadata class defined for data contract object" in Dynamics AX 2012

Published: October 8, 2020 at 4:33:20 PM UTC

A short little article describing a somewhat cryptic error message in Dynamics AX 2012, as well as the most likely cause and fix for it.


The information in this post is based on Dynamics AX 2012 R3. It may or may not be valid for other versions.

I recently encountered the somewhat cryptic error message "No metadata class defined for data contract object" when trying to start a SysOperation controller class.

After a bit of investigation, it turns out that the cause of this was that I forgot to decorate the ClassDeclaration of the data contract class with the [DataContractAttribute] attribute.

It seems there are a couple of other possible causes, but the above is the by far most likely one. Strange that I haven't encountered it before, but I guess I've never forgotten that attribute before, then ;-)

Hereby noted for future reference :-)

Share on BlueskyShare on FacebookShare on LinkedInShare on TumblrShare on XShare on LinkedInPin on Pinterest

Mikkel Bang Christensen

About the Author

Mikkel Bang Christensen
Mikkel is the creator and owner of miklix.com. He has over 20 years experience as a professional computer programmer/software developer and is currently employed full-time for a large European IT corporation. When not blogging, he spends his spare time on a vast array of interests, hobbies, and activities, which may to some extent be reflected in the variety of topics covered on this website.