AX 2009 AIF error: This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded

When I browse the 'SalesOrderService.svc' file in IIS, I get the following error:

Server Error in '/MicrosoftDynamicsAXAif50' Application.

Configuration Error

Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.

Parser Error Message: Could not load file or assembly 'microsoft.dynamics.integrationframework.service' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded.

WebHost failed to process a request. Sender Information: System.ServiceModel.ServiceHostingEnvironment+HostingManager/25753987 Exception: System.ServiceModel.ServiceActivationException: The service '/MicrosoftDynamicsAXAif50/salesorderservice.svc' cannot be activated due to an exception during compilation. The exception message is: Could not load file or assembly 'microsoft.dynamics.integrationframework.service' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded. (C:\Windows\Microsoft.NET\Framework64\v2.0.50727\Config\web.config line 59). ---> System.Configuration.ConfigurationErrorsException: Could not load file or assembly 'microsoft.dynamics.integrationframework.service' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded. (C:\Windows\Microsoft.NET\Framework64\v2.0.50727\Config\web.config line 59) ---> System.BadImageFormatException: Could not load file or assembly 'microsoft.dynamics.integrationframework.service' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded.File name: 'microsoft.dynamics.integrationframework.service' at System.Reflection.Assembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection) at System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) at System.Reflection.Assembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) at System.Reflection.Assembly.Load(String assemblyString) at System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective)

<!-- Configure tracing information for debugging in production version --> <system.diagnostics> <!-- This is relevant only for DEBUG build. This disables assert dialog when Debug.Assert() is used in code. Since code will be running in IIS (no-ui) we have to disable dialogs. We will redirect it to a file Please make sure to give a full file path to where the assertion file should be located --> <assert assertuienabled="false" logfilename="AifDebugAsserts.webinfo" />

<appSettings> <!-- This is the name of the 'system wide'/'global' configuration that should be used to log on using .NET Business Connector. The default case of the value being empty is - Business connector will log on to Microsoft Dynamics using the first available configuration from the registry and use it. The value of the key can be: 1. The name specified for the new global configuration. 2. The file name (with full path) to the exported configuration. If this value is specified, this configuration is used to log on to Microsoft Dynamics Usage: Override this value in case you dont want the default behavior of configuration. E.g. connect to different AOS server, or use a different default company etc. --> <add key="BUSINESS_CONNECTOR_CONFIGURATION" value=""/> </appSettings>