c# - Mixed Mode C++/CLI System.IO.FileLoadException -


my solution contains 2 projects.

first project c++ win32 application , second project c# library manages 2 other c# libraries not built me. idea behind build c# library handles these other 2 c# libraries.

now, these 2 c# libraries built .net 3.5 , have set c# project built .net 3.5 aswell.

i created c++ wrapper, works quite well. problem appears when trying create object of class c# library gets 1 of other 2 libaries.

mixed mode assembly built against version 'v2.0.50727' of runtime , cannot loaded in 4.0 runtime without additional configuration information. 

now, have been looking on dozen posts issue has been posted. none of them solved issue. have tried several different config files executable(my c++ project), aswell c# library.

i have tried

<startup uselegacyv2runtimeactivationpolicy="true">     <supportedruntime version="v4.0" sku=".netframework,version=v4.0"/>     <supportedruntime version="v2.0.50727"></supportedruntime>   </startup> 

and several other ones alike.

it seems in project have v2.0.50727 dlls. try this:

edit app.config file , add:

<configuration>   <startup uselegacyv2runtimeactivationpolicy="true">     <supportedruntime version="v4.0" sku=".netframework,version=v4.0"/>   </startup> </configuration> 

Comments