Total Pageviews

Search This Blog

Sunday, June 19, 2011

Update - Tip - Visual Studio 2010 Ultimate and Dynamics AX .Net Business Connector Compatibility Settings

Issue:

I bumped into this error when building my .Net app (using Visual Studio 2010 Ultimate)  which consumes Dynamics AX 2009 (.Net Business Connector assembly)

 Solution -

Update - In my specific scenario, I'm not leveraging any of the .Net 4.0 Framework features, so I just changed the Framework Version to 3.5 to make this work.



But, if you are targetting .Net 4.0, you need to perform an additional change in config after you change the Framework version to 4.0 otherwise you will run into the following error:

"Mixed mode assembly is built against version 'v2.0.50727' of the runtime and cannot be loaded in the 4.0 runtime without additional configuration information"

In order to fix this error, just add this specific entry in your app.config under configuration section:
startup useLegacyV2RuntimeActivationPolicy="true", so now your modified app.config should look like the below:

And you should be good to go now with .Net 4.0!

P.S Florian has a theory on .Net 4.x compatibility with AX 2009 BC in his blog , but without making this additional change in config as I have shown above, it won't work and as said before I was just using a basic .Net 3.5 targetted app just to test one of my AX BC Classes

4 comments:

Unknown said...

Hello Dilip,
I don't agree to your conclusion that this error occurs because the BC.Net is compiled on the CLR2 (.Net 3.5). I posted a comment to this here:
http://floditt.blogspot.com/2011/06/net-40-client-profile-not-enough-for.html
Kind regards,
Florian

Unknown said...

Hello Dilip,
thanks for the useLegacyV2RuntimeActivationPolicy. I should have pointed that out.
Cheers,
Florian

Unknown said...
This comment has been removed by the author.
Arrowsoltraining said...

Arrowsol Training been the one stop solution for all the training needs anyone looks for. The expertise of the faculty training here will make you the most prolific and fluent in any subject you are looking for.

Many students are trying to get best Microsoft Dynamics AX (Axapta) training in Hyderabad. If you are one among them, you can consider attending Arrowsol Training Institute which is located at Ameerpet, Hyderabad.
Microsoft Dynamics AX online training