Dynamics AX 2012 Error When Importing Modelstore

by | Updated November 13, 2019 | Dynamics AX

When importing model files from an ISV or another vendor you may trigger an error within Dynamics AX.

We recently faced this error in Dynamics AX 2012 when importing modelstore  while working on a client account:

ERROR: Could not load file or assembly ‘C:\TEMP\demo1.axmodel’ or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded.

This is a common error and the solution can vary depending on your current environment. In this blog, we have compiled links to a variety of sources that we have found helpful to resolve this issue.

Microsoft employee Anup Shah wrote a blog on how to import model files using Export-AXModel. Using Powershell Version 2 as the blog recommends works in some cases, but not all. This is due to newer .Net being used when building the axmodel file instead of .NET 2.0 as explained here.

Here is a possible way of changing the RunTime version of the model file to 2.0, so you can import the model.

If the two above solutions do not work, you can follow the steps below to resolve the issue:

1.Download the iLSpy application.

Use iLSpy to see the .Net version used when the Axmodel file was built. This is optional and only if you are curious! This link will give you the ILSpy executable file.

Once downloaded, unzip it to a folder.  In the folder you extracted the files to, you will them see the ILspy.exe file.  This is the only file you need to launch the ILSpy application. Double click on ilSpy.exe to launch the application. In the ILSpy application, browse to your Axmodel file. You will then see the Runtime version is something other than 2.0 – like shown here – https://daxmusings.codecrib.com/2012/05/axutillibdll-issue-with-net-4.html

2. Download the ILMerge msi file using this link.

Then follow these steps (per the blog) to fix the issue –

Once downloaded and installed (it installs to C:\Program files (x86)\Microsoft\ILMerge) you can change the target version from the command prompt, like this:

ILMerge mymodel.axmodel /targetplatform:2.0 /out:mynewmodel.axmodel

You should now be able to import the new model into Dynamics AX.

If you need assistance or have any other questions, please reach out to the AX team at Stoneridge Software.

Related Posts

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

Upcoming Events

august

13aug11:00 am12:00 pmConfab with Stoneridge - Livestream - Inspire Keynote Breakdown

19aug10:00 am11:00 amWhat is Levridge? An Overview of the Ultimate Ag Solution

19aug12:00 pm12:30 pmThe Modern Manufacturer - Death by Safety Stock

27aug12:00 pm1:00 pmConfab with Stoneridge - Livestream - Dynamics 365 2020 Wave 2 Preview

september

02sep10:00 am10:30 amThe Modern Manufacturer - Cycle Count Management

09sep10:00 am11:00 amWhat is Levridge? An Overview of the Ultimate Ag Solution

16sep10:00 am10:30 amThe Modern Manufacturer - Product Lifecycle Management

30sep10:00 am10:30 amThe Modern Manufacturer - Return Management

About Stoneridge
Stoneridge Software is a unique Microsoft Gold Partner, with emphasis on partner. With specialties in Microsoft Dynamics 365, Microsoft Dynamics AX, Microsoft Dynamics NAV, Microsoft Dynamics GP and Microsoft Dynamics CRM, we focus on attracting the most knowledgeable experts in the field to our team, and prioritize delivering stellar solutions with maximum impact for your business. At Stoneridge, we are deeply committed to your results. Each engagement is met with a dedicated team, ready to provide thorough, tailored, and expert service. Based in Minnesota, we intentionally “step into your shoes,” wherever you are. We focus on what you care about, and develop trusting, long-term relationships with our clients.

Subscribe To Our Blog

Sign up to get periodic updates on the latest posts.

Thank you for subscribing!

X