为什么Visual Studio 2015无法运行exe文件(ucrtbased.dll)? [英] Why Visual Studio 2015 can't run exe file (ucrtbased.dll)?

查看:365
本文介绍了为什么Visual Studio 2015无法运行exe文件(ucrtbased.dll)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经安装了Visual Studio 2015,并使用一些代码创建了Win32项目.我已成功编译它,但由于没有ucrtbased.dll,因此无法启动exe文件...那么该如何解决呢?

I have installed the Visual Studio 2015 and created Win32 project with some code. I compiled it successfully, but I can't launch exe file, because I don't have some ucrtbased.dll...So how can I solve it?

英文等效的消息是: 该程序无法启动,因为您的计算机缺少ucrtbased.dll.请尝试重新安装该程序以解决此问题."

The English equivalent message is: "The program can't start because ucrtbased.dll is missing from your computer. Try reinstalling the program to fix this problem. "

推荐答案

此问题来自VS 2015,在安装Visual期间静默地未能将ucrtbased.dll(调试)和ucrtbase.dll(发行版)复制到适当的系统文件夹中工作室. (或者在安装过程中未选择"Visual C ++ 2015通用工具".)因此,重新安装可能会有所帮助.但是,重新安装是一种极端的措施...无需完全重新安装就可以解决此问题.

This problem is from VS 2015 silently failing to copy ucrtbased.dll (debug) and ucrtbase.dll (release) into the appropriate system folders during the installation of Visual Studio. (Or you did not select "Common Tools for Visual C++ 2015" during installation.) This is why reinstalling may help. However, reinstalling is an extreme measure... this can be fixed without a complete reinstall.

首先,如果您不太在意根本问题,只是想让这个项目快速运行,那么这里是一个快速的解决方案:只需将ucrtbased.dllC:\Program Files (x86)\Windows Kits\10\bin\x86\ucrt\ucrtbased.dll(用于32位调试)复制到您的应用程序的\ debug目录以及可执行文件.然后它将被发现并且错误将消失.但是,这仅适用于这个 one 项目.

First, if you don't really care about the underlying problem and just want to get this one project working quickly, then here is a fast solution: just copy ucrtbased.dll from C:\Program Files (x86)\Windows Kits\10\bin\x86\ucrt\ucrtbased.dll (for 32bit debug) into your application's \debug directory alongside the executable. Then it WILL be found and the error will go away. But, this will only work for this one project.

一个更永久的解决方案是将ucrtbased.dllucrtbase.dll放入正确的系统文件夹中.现在我们可以开始将这些文件复制到\ Windows \ System32和\ SysWOW64,并且可能可以解决此问题.但是,这不是最佳解决方案.首先出现失败的原因是,以这种方式强制使用特定的.dll可能会导致问题.

A more permanent solution is to get ucrtbased.dll and ucrtbase.dll into the correct system folders. Now we could start copying these files into \Windows\System32 and \SysWOW64, and it might fix the problem. However, this isn't the best solution. There was a reason this failed in the first place, and forcing the use of specific .dll's this way could cause problems.

最好的解决方案是打开控制面板->程序和功能-> Microsoft Visual Studio 2015->修改.然后取消选中并重新选中"Visual C ++-> Visual C ++ 2015的常用工具".单击下一步",然后单击更新",几分钟后,它应该可以正常工作了.

The best solution is to open up the control panel --> Programs and Features --> Microsoft Visual Studio 2015 --> Modify. Then uncheck and re-check "Visual C++ --> Common Tools for Visual C++ 2015". Click Next, then and click Update, and after a few minutes, it should be working.

如果仍然无法正常运行,请再次运行修改工具,取消选中"Visual C ++ 2015的常用工具",然后应用卸载该组件.然后再次运行,进行检查,然后申请重新安装.确保已禁用防病毒软件,没有其他任务打开等,并且该软件应该可以工作.这是确保将这些文件精确复制到应有的位置的最佳方法.

If it still doesn't work, run the modify tool again, uncheck the "Common Tools for Visual C++ 2015", and apply to uninstall that component. Then run again, check it, and apply to reinstall. Make sure anti-virus is disabled, no other tasks are open, etc. and it should work. This is the best way to ensure that these files are copied exactly where they should be.

请注意,如果此时修改工具给出了错误代码,则该问题几乎肯定是特定于您的系统的.研究错误代码,找出问题所在,并希望如何解决.

Note that if the modify tool gives an error code at this point, then the problem is almost certainly specific to your system. Research the error code to find what is going wrong and hopefully, how to fix it.

这篇关于为什么Visual Studio 2015无法运行exe文件(ucrtbased.dll)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆