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)
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
I bumped into this error when building my .Net app (using Visual Studio 2010 Ultimate) which consumes Dynamics AX 2009 (.Net Business Connector assembly)
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