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

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/2334005/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-07 01:31:28  来源:igfitidea点击:

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

c#.netvisual-studiowindows-7compiler-errors

提问by shahjapan

采纳答案by Nick Craver

From Microsoft Connect:

从微软连接

  1. Locate regcap.exe here: 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.
  6. Click Ok and Recompile.
  1. 在此处找到 regcap.exe:C:\Program Files\Microsoft Visual Studio 9.0\Common7\Tools\Deployment
  2. 右键单击并选择属性。
  3. 选择兼容性选项卡
  4. 复选框以在兼容模式下运行此程序。
  5. 在操作系统下拉菜单中选择 Windows Vista SP2 并以管理员身份运行。
  6. 单击确定并重新编译。

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 步中,您只需选中最后一个组框“特权级别”中的复选框“以管理员身份运行此程序”

回答by sw.

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,我排除了它并且编译正常。

回答by Nguyen

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. I then try to build again in 32-bit and run Visual Studio in Compatibility mode and it works.

这在我的情况下有效。我构建了我的项目 VS 2008 和 Windows 7-64 位,并有相同的错误消息。然后我尝试在 32 位中再次构建并在兼容模式下运行 Visual Studio 并且它可以工作。

  1. Run Visual Studio in Compatibility mode for Windows XP:

    • Right click Visual studio icon

    • 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

  2. Go to Configuration manager and Debug your project in X86 mode

  1. 在 Windows XP 的兼容模式下运行 Visual Studio:

    • 右键单击 Visual Studio 图标

    • 选择属性

    • 在兼容性选项卡中,选中在 Windows XP SP3 的兼容模式下运行此程序并选中以管理员身份运行此程序

  2. 转到配置管理器并在 X86 模式下调试您的项目

回答by John Pittaway

I ran into this build an MSI project using VS 2008 on Windows 7 64 bit. The problem was that an assembly that reference Microsoft.InteropFormTools.tlb and had to be callable from VB 6 through COM. Visual Studio defaulted the type library's Registry property to vsdrfCOMSelfReg. Changing it to vsdrfDoNotRegister solved the problem.

我在 Windows 7 64 位上使用 VS 2008 构建了一个 MSI 项目。问题是引用 Microsoft.InteropFormTools.tlb 的程序集必须可以从 VB 6 通过 COM 调用。Visual Studio 将类型库的注册表属性默认为 vsdrfCOMSelfReg。将其更改为 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”的文件创建注册信息

回答by Robert Cody

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. I added the class to the project, but forgot to remove the reference to the DLL. Removing the reference to the external component resolved the problem and this error message no longer occurred.

当我尝试将一个类添加到我的项目中时,我也遇到了这个错误,该类以前被编译为作为引用添加的外部 DLL。我将该类添加到项目中,但忘记删除对 DLL 的引用。删除对外部组件的引用解决了问题,并且不再出现此错误消息。

回答by Caleb Hanson

In case anyone is running into this issue with Visual Studio 2015, the path for regcap is now C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\CommonExtensions\Microsoft\VSI\bin.

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