在已安装了.net framework的计算机上部署用.net开发的程序时,若.net framework的版本不匹配,则提示:“ .Net Framework Initialization Error – Unable to find a version of the runtime to run this application”。
这时候有个简单的办法是,修改(如果没有则创建)程序xxx.exe所在目录的和xxx.exe同名的config文件——xxx.exe.config,使其:
<configuration>
  <startup>
    <supportedRuntime version="v4.0.30319" />
  </startup>
</configuration
 
version处填写计算机以安装的.net framework版本号(可在控制面板的添加删除程序处看到.net framework的版本号)。
 
这个方法免去了版本号不一致时的各种纠结

相关文章:

  • 2021-12-06
  • 2021-12-06
  • 2021-08-22
  • 2021-12-16
  • 2021-12-27
  • 2022-12-23
  • 2022-01-08
  • 2022-12-23
猜你喜欢
  • 2021-12-24
  • 2021-09-12
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-05-24
  • 2021-10-24
相关资源
相似解决方案