.Net framework - “unable to find a version of the runtime to run this application”

﹥>﹥吖頭↗ 提交于 2019-12-20 04:36:20

问题


Machine with /Net framework version 4.0 installed m/c (win xp with sp3) (no previous framework version present) when try to run the program which is compiled in framework previous version of .net framework i.e =>3.5 ,came across below initialization error "unable to find a version of the runtime to run this application". on googling found -changing config <startup> <supportedRuntime version="v4.0.30319" /> </startup> may help to solve, but that too didn't work. Any help would be appreciated.


回答1:


I could able to solve this issue. Below info would be a help for someone who is in my situation.

insert below startup tag in your application.config file

<?xml version="1.0"?>
<configuration>
  <startup useLegacyV2RuntimeActivationPolicy="true">
    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
  </startup>
</configuration>

May be this blog entry would also be helpful: NET 4.0 and Mixed-mode assemblies



来源:https://stackoverflow.com/questions/7335133/net-framework-unable-to-find-a-version-of-the-runtime-to-run-this-applicatio

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!