|
| Mixed Mode Assembly error in WD |
| Iniciado por guest, 13,sep. 2014 05:06 - 3 respuestas |
| |
| | | |
|
| |
| Publicado el 13,septiembre 2014 - 05:06 |
Greetings,
I have a 64-bit Framework 4.0 C# assembly that works great until I use the WD DoNetDelegate. Then I get the following error:
Error returned by .NET Framework: 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.
After many, many google searches, I only find that you need a .config file with startup parameters. However, adding that with a WD generated EXE file does not seem to use that .config file.
So, I have done everything I can to make sure all references in my c# assembly use framework 4.0 (minimum for the SDK I am using) but still I get the error. When I select the system.dll file for reference from the 4.0 framework, it changes the path to be x86. I have found that if I add a WD .NET reference to System.dll first, it prevents the problem. But why?
Any comments or suggestions would be appreciated |
| |
| |
| | | |
|
| | |
| |
| Publicado el 15,septiembre 2014 - 15:09 |
Hi Jeff,
Maybe this post can help you: <a class="ExternalLink" rel="nofollow" target="_blank" href="http://stackoverflow.com/questions/2455654/what-additional-configuration-is-necessary-to-reference-a-net-2-0-mixed-mode">http://stackoverflow.com/questions/2455654/what-additional-configuration-is-necessary-to-reference-a-net-2-0-mixed-mode</a>
Best regards, Alexandre Leclerc |
| |
| |
| | | |
|
| | |
| |
| Publicado el 15,septiembre 2014 - 17:13 |
Hi Alexandre,
There are many such posts and I have the useLegacyV2RuntimeActivationPolicy="true" in both a C# app.config and in the .exe.config file, but WD does not seem to use the .config file. There is no problem with the C test file, just with WD DotNetDelegate command. Thanks for the response. |
| |
| |
| | | |
|
| | |
| |
| Publicado el 09,enero 2015 - 13:31 |
Hi !
We had an .NET 2.0 dll used in our application and everything was working fine until we imported a .NET 4.0 dll. Since then, the application can use the .NET 4.0 classes & functions but all code related to the .NET 2.0 dll is not working anymore, raising the following exception :
Le framework .NET a renvoyé l'erreur suivante : System.IO.FileLoadException: 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. at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) at System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) at System.Reflection.RuntimeAssembly.InternalLoadFrom(String assemblyFile, Evidence securityEvidence, Byte[] hashValue, AssemblyHashAlgorithm hashAlgorithm, Boolean forIntrospection, Boolean suppressSecurityChecks, StackCrawlMark& stackMark) at System.Reflection.Assembly.LoadFrom(String assemblyFile) at CDotNetLoader.vpiLoadAssembly(CDotNetLoader* , Char* pszFileName, CXError* pclErreur) L'assemblage <CisDotNetWrapper> n'a pas pu être ouvert.
Then, we removed the .NET 4.0 dll but the problem remains ! How can we force Windev to use the .NET 2.0 runtime ?
Thank you ! |
| |
| |
| | | |
|
| | | | |
| | |
|