Mixed Mode issue with WCF projects

11/2/2012 4:13:36 PM
Gravatar
Total Posts 13

Mixed Mode issue with WCF projects

I have created a WCF project where i have referenced the NCryptoki and NCryptokiMngd but when running the service on initialization the cryptoki object it is showing 

 

"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."

 

I have added the below information to the App.Config:

<startup useLegacyV2RuntimeActivationPolicy="true">
    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
    <requiredRuntime version="v4.0.20506"/>
  </startup>
  <runtime>
    <generatePublisherEvidence enabled="false" />
  </runtime>

but unfortunately no solution.

I have also checked that i am using the right .dlls compatible with my OS 32 bits.

 

Thanks in advance for your help!

11/2/2012 4:55:59 PM
Gravatar
Total Posts 300
Ugo Chirico http://www.ugochirico.com

Re: Mixed Mode issue with WCF projects

Are you sure that the app config file is loaded by your service?

I cannot find any other stuff that can cause such a problem.

11/5/2012 9:00:28 AM
Gravatar
Total Posts 13

Re: Mixed Mode issue with WCF projects

Ok thank u problem has been resolved. 

 

I have included the below information in the client and host configuration file :

 

<startup useLegacyV2RuntimeActivationPolicy="true">
    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
    <requiredRuntime version="v4.0.20506"/>
  </startup>


  <runtime>
    <generatePublisherEvidence enabled="false" />
  </runtime>