Could not load file or assembly ‘ModelName.axmodel’ or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded. – AX 2012

Hi Guys,

I hope you are doing good.  Today I’m gonna share you very intresting thing,  Don’t scare by looking this title but solution is very simple.

I was trying to install my Model File to new environment. But It throws an error

1

For this issue solution is very Simple. Even it took some time to figure out the reason.

The reason behind the error is you may Export Model using Microsoft Dynamics AX 2012 Management Shell on Windows Server 2012 or Windows Server 2012 R2 and then you try to install this model file in Windows Server 2008.

The Axutil and Powershell for MSDAX of dll was built by using the Microsoft .NET Framework version 2.0

When I looked into the New Environment same way I found CLR version as 2.0

CustomerVersion

Same Way when I looked it ,where I Exported this Model, I found CLR version as 4.0

MyVersion

So what I have to do now ? I have to Update the CLR Version as 4.0. I have created three configuration files

  • AXUtil.exe.config
  • powershell.exe.config
  • powershell_ise.exe.config
<?xml version="1.0" encoding="utf-8" ?> 
<configuration> 
  <startup useLegacyV2RuntimeActivationPolicy="true"> 
    <supportedRuntime version="v4.0.30319" /> 
<supportedRuntime version="v3.5" /> 
<supportedRuntime version="v2.0.50727"/>
  </startup> 
</configuration>  

Each File should contain the above code and it should be saved in AOS Altbin location, you can find it from Microsoft Dynamics Ax 2012 Server Configuration.

So everything is done. Now you try to import the model again.

Problem Solved 🙂

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s