简体   繁体   English

调试附加到进程时出现 Visual Studio 2019 错误

[英]Visual Studio 2019 Error when debug attach to process

I have used visual studio 2019 (C#) to develop an add-in for Revit software.我使用 visual studio 2019 (C#) 为 Revit 软件开发了一个插件。 But when I debug "attach to process".但是当我调试“附加到进程”时。 My Visual studio return a error "Your app has entered a break state, but no code is currently executing that is supported by the selected debug engine (eg only native runtime code is executing)."我的 Visual Studio 返回错误“您的应用程序已进入中断 state,但当前没有执行所选调试引擎支持的代码(例如,只有本机运行时代码正在执行)。” with exception "An unhandled exception of type 'System.ExecutionEngineException' occurred in Unknown Module.".例外情况是“未知模块中发生类型为‘System.ExecutionEngineException’的未处理异常。”。 Does anybody have a solution to fix my error.有没有人有解决我的错误的解决方案。 Thank you: note: I have used plugin "Add-in manager" to debug my code谢谢:注意:我使用插件“加载项管理器”来调试我的代码在此处输入图像描述

The message says ", but no code is currently executing that is supported by the selected debug engine..."该消息显示“,但当前没有执行所选调试引擎支持的代码...”

There are two ways to debug revit addins with visual studio, either load the assembly at runtime (with invokemethod).使用 visual studio 调试 revit 插件有两种方法,一种是在运行时加载程序集(使用 invokemethod)。 Or start a new session of Revit.exe with the debug tools.或者用调试工具启动一个新的 Revit.exe session。

If you install some nuget packages with x64 , you should change your project to Debug/x64 while install some x86 nuget packages, you should change it to Debug/x86 .如果你用x64安装一些 nuget 包,你应该将你的项目更改为Debug/x64而安装一些x86 nuget 包,你应该将它更改为Debug/x86

First , try to disable the option Enable Just My Code under Tools --> Options --> Debugging --> General首先,尝试在Tools --> Options --> Debugging --> General下禁用选项Enable Just My Code

Then , open your project in VS,right-click on the project Properties --> Debug --> check Enable Native Code Debugging option.然后,在 VS 中打开您的项目,右键单击项目属性-->调试--> 检查启用本机代码调试选项。

After that , rebuild your project and then run the program first on the current system.之后,重建您的项目,然后首先在当前系统上运行该程序。 With it, you can use Attach to Process to debug this process.有了它,您就可以使用Attach to Process来调试这个进程。

Since I am not familiar with revit , you could try these suggestions to troubleshoot the issue.由于我不熟悉revit ,您可以尝试这些建议来解决问题。

I fixed my error.我修正了我的错误。 I Uninstalled some add-in which I installed before.我卸载了之前安装的一些插件。 That fine没事

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM