In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article is to share with you what to do if you don't pass the compilation when you encounter different versions of the. Net framework 4.0 environment. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.
Recently, the development environment of the department has been updated to WIN7+.NET framework4+VS2010, which brings us some compatibility problems while experiencing the ways and means that new technologies and environments bring us to improve efficiency. In the past few days, when the project was studying SQLite in its spare time, I encountered a problem during the experiment. When the code was compiled and executed, it was found that SQLite.dll was compiled under the framework2.0 environment, but now the running environment is framework4.0, so there is a run exception, as shown in the figure:
Since some third-party components may be referenced in the future development process, which may be compiled under the old version of framework, such problems will also occur, so a solution and explanation of the cause of this problem are provided in this article.
After consulting the relevant information, it is recommended to add the configuration to the config file on stackoverflow.com:
The copy code is as follows:
This method is also described on MSDN, see http://msdn.microsoft.com/en-us/library/bbx34a2h(VS.100).aspx
However, the problem remains unresolved after compilation using this method, but the problem can be explicitly locked into the. Net runtime environment.
The copy code is as follows:
Run it again and the problem is solved. Now we need to know what caused it?
The supportedRuntime tag is used to specify which version of the .framework runtime the application supports
The requiredRuntime tag is used to specify that the application only supports version 1. 0 common language runtime. If you use version 1.1 or later to compile, the application must use elements
Note:
Must be used by applications compiled with version 1.1 or later. Applications that support only version 1.0 run time must use.
Check the relevant materials of the CLR Runtime version again, and quote the following CLR running rules and the summary table of the relationship between the versions, as follows:
Rules:
1. Applications compiled by CLR4.0 or above always run on the CLR version in which the application is compiled
2. Applications compiled by the following version of CLR4.0 will first run on the compiled version of CLR. If this version does not exist, run the latest version smaller than CLR4.0.
The summary is as follows:
The CLR version number of the EXE being compiled
CLR 1.1 is installed on the machine.
CLR 2.0 is installed on the machine?
CLR 4. 0 is installed on the machine.
Result
1.1
Yes
It doesn't matter
It doesn't matter
Load CLR 1.1
2.0
It doesn't matter
Yes
It doesn't matter
Load CLR 2.0
1.1
No
Yes
It doesn't matter
Load CLR 2.0
1.1
No
No
Yes
Fail
2.0
It doesn't matter
No
Yes
Fail
Thank you for reading! This is the end of this article on "what to do if you encounter different versions of the compiler in the .net framework 4.0environment". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it out for more people to see!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.