C# Error Message: .NET 2.0 DLL in .NET 4.0 cannot be loaded in the 4.0 runtime without additional configuration information
Question by Guest | Last update on 2021-06-13 | Created on 2012-12-27
I have a DLL that was developed in the Dot Net version 2.0 and I would like to reference to it in .Net Framework 4.0.
However, this leads to the following error:
Cannot intercept exception. Debugged program can not be continued and properties can not be evaluated. 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.
There is mentioned "additional configuration information", ie any additional configurations that must obviously be made to use the DLL.
Can someone tell me, what kind of settings or parameters I have to set?
Related Topics
Lazarus: Program without GUI - Many WSRegister Errors
Question | 6 Answers
Delphi: Global Treatment of Errors (Exceptions)
Tutorial | 0 Comments
Put Windows via Script into Hibernation or Sleep Mode
Tutorial | 0 Comments
Delphi/Lazarus: Create TabSheet on PageControl dynamically
Tutorial | 0 Comments
Create Custom Error Pages for Website
Tip | 0 Comments
VirtualBox: Change Date and Time
Tutorial | 10 Comments
Windows Batch Script: Computer Shutdown
Tutorial | 2 Comments
Important Note
Please note: The contributions published on askingbox.com are contributions of users and should not substitute professional advice. They are not verified by independents and do not necessarily reflect the opinion of askingbox.com. Learn more.
Participate
Ask your own question or write your own article on askingbox.com. That’s how it’s done.
Your DLL is a CLR 2.0 mixed mode assembly. To use these, you need to add to your app.config file of your project the line <startup useLegacyV2RuntimeActivationPolicy="true" />, so that your app.config looks like this, for example:
Thereby you are telling the CLR, which version it should use to load your DLL. However, this does not apply to managed assemblies. So, a CLR 2.0 managed assembly can be loaded even without this line.
Last update on 2021-06-13 | Created on 2012-12-27
I have added these lines in app.config but its not working. I am using sqlite dll with visual studio 2010.
2013-06-12 at 07:22
Are you using the SQLite DLL provided especially for .NET? On the SQLite Download Page, there is a section "Precompiled Binaries for .NET". I think this should work for you.
2013-06-13 at 01:15
Hello,
I have already changed in App.Config file like this
and target framework also changed. But I got an exception while i was executing the database script with ExecuteNonQuery method.
Any Idea about the problem?
Thanks in advance.
2014-03-10 at 13:24