简体   繁体   English

Visual Studio 注册表捕获实用程序已停止工作,在 Windows7 中编译 C# 项目时出错

[英]Visual Studio registry capture utility has stopped working, error compiling C# project in Windows7

Visual Studio registry capture utility has stopped working.... http://easycaptures.com/fs/uploaded/256/9376236710.png Visual Studio 注册表捕获实用程序已停止工作.... http://easycaptures.com/fs/uploaded/256/9376236710.png

Windows 7 Shows build error like below everytime I compile my project.每次编译我的项目时,Windows 7 都会显示如下构建错误。

From Microsoft Connect : 从微软连接

  1. Locate regcap.exe here: C:\\Program Files\\Microsoft Visual Studio 9.0\\Common7\\Tools\\Deployment在此处找到 regcap.exe:C:\\Program Files\\Microsoft Visual Studio 9.0\\Common7\\Tools\\Deployment
  2. Right click and select properties.右键单击并选择属性。
  3. Select Compatibility tab选择兼容性选项卡
  4. Check box to Run this program in compatibility mode.复选框以在兼容模式下运行此程序。
  5. Select Windows Vista SP2 in the OS drop-down and Run as Administrator.在操作系统下拉菜单中选择 Windows Vista SP2 并以管理员身份运行。
  6. Click Ok and Recompile.单击确定并重新编译。

This solution also works on Windows 7 with Visual Studio 2008 (32 bit version), where in the 5th step, you just need to select the check box in the last group box "Privilege Level" for "Run this program as an administrator"此解决方案也适用于带有 Visual Studio 2008(32 位版本)的 Windows 7,其中在第 5 步中,您只需选中最后一个组框“特权级别”中的复选框“以管理员身份运行此程序”

Another reason From Add-In-Express : 来自 Add-In-Express 的另一个原因:

  • Long paths (a buffer overflow?).长路径(缓冲区溢出?)。 This was my case: I had *.tlb in a setup project with a long path, I excluded it and it compiled ok.这是我的情况:我在一个带有很长路径的安装项目中有 *.tlb,我排除了它并且编译正常。

I ran into this build an MSI project using VS 2008 on Windows 7 64 bit.我在 Windows 7 64 位上使用 VS 2008 构建了一个 MSI 项目。 The problem was that an assembly that reference Microsoft.InteropFormTools.tlb and had to be callable from VB 6 through COM.问题是引用 Microsoft.InteropFormTools.tlb 的程序集必须可以从 VB 6 通过 COM 调用。 Visual Studio defaulted the type library's Registry property to vsdrfCOMSelfReg. Visual Studio 将类型库的注册表属性默认为 vsdrfCOMSelfReg。 Changing it to vsdrfDoNotRegister solved the problem.将其更改为 vsdrfDoNotRegister 解决了问题。

TIP: Pay attention to the Output window during the Build/Rebuild processing.提示:在构建/重建过程中注意输出窗口。 I saw the following warning after I closed RegCap program:我关闭 RegCap 程序后看到以下警告:

Note: Unable to create registration information for file named 'Microsoft.InteropFormTools.tlb'注意:无法为名为“Microsoft.InteropFormTools.tlb”的文件创建注册信息

如果有人在 Visual Studio 2015 中遇到这个问题,regcap 的路径现在是 C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\Common7\\IDE\\CommonExtensions\\Microsoft\\VSI\\bin。

I also encountered this error when I tried to add a class to my project that had previously been compiled as an external DLL that was added as a reference.当我尝试将一个类添加到我的项目中时,我也遇到了这个错误,该类以前被编译为作为引用添加的外部 DLL。 I added the class to the project, but forgot to remove the reference to the DLL.我将该类添加到项目中,但忘记删除对 DLL 的引用。 Removing the reference to the external component resolved the problem and this error message no longer occurred.删除对外部组件的引用解决了问题,并且不再出现此错误消息。

If your project doesn't require to build in 64bit , you can build it in 32 bit instead.如果您的项目不需要以 64 位构建,则可以改为以 32 位构建。

This works in my case.这在我的情况下有效。 I build my project VS 2008 and Windows 7-64 bit and have the same error message.我构建了我的项目 VS 2008 和 Windows 7-64 位,并有相同的错误消息。 I then try to build again in 32-bit and run Visual Studio in Compatibility mode and it works.然后我尝试在 32 位中再次构建并在兼容模式下运行 Visual Studio 并且它可以工作。

  1. Run Visual Studio in Compatibility mode for Windows XP:在 Windows XP 的兼容模式下运行 Visual Studio:

    • Right click Visual studio icon右键单击 Visual Studio 图标

    • Select Properties选择属性

    • In Compatibility tab, check on Run this program in compatibility mode for Windows XP SP3 and check on Run this program as administrator在兼容性选项卡中,选中在 Windows XP SP3 的兼容模式下运行此程序并选中以管理员身份运行此程序

  2. Go to Configuration manager and Debug your project in X86 mode转到配置管理器并在 X86 模式下调试您的项目

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 编译时出现Visual Studio错误-“ Microsoft.VsHub.Server.HttpeHostx64.exe停止工作” - Visual Studio Error when Compiling - “Microsoft.VsHub.Server.HttpeHostx64.exe has stopped working” 编译时出现“ Microsoft Resource File to COFF Object Conversion Utility已停止工作”错误 - “Microsoft Resource File to COFF Object Conversion Utility has stopped working” error when compiling Visual Studio C#项目参考无法正常工作 - Visual Studio C# Project Reference not working Registry.GetValue错误。 Visual Studio 2010中的C# - Registry.GetValue Error. C# in Visual Studio 2010 Visual Studio 2013、2015已停止工作 - Visual Studio 2013, 2015 Has stopped working 注册表测试注册表键值 - C# Visual Studio 2019 - Registry test registry key value - C# Visual Studio 2019 Windows Phone Notefunction的Visual Studio 2010中的C#项目 - C# Project in Visual Studio 2010 for Windows Phone Notefunction 一个c#项目(MS Visual Studio)中有2个表单或窗口 - 2 forms or windows in one single c# project (MS visual studio) Visual Studio C#-编译应用程序? - Visual Studio C# - Compiling application? Visual Studio 2017 c#控制台项目不提供命名空间win32.registry - Visual Studio 2017 c# console project does not provide namespace win32.registry
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM