你的应用进入了中断状态,但当前未执行任何受选定调试引擎支持的代码(例如,仅在执行本机运行时代码)

版权声明:本文为博主原创文章,转载请保留原文链接。联系邮箱:[email protected] https://blog.csdn.net/Liwuqingxin/article/details/82799288

错误信息

英文错误信息:Your app has entered a break state, but no code is currently executing that is supported by the selected debug engine

环境

IDE:VS2017,调试外部程序(代码为外部程序加载插件)

外部程序API:.NetFramework 4.0;

插件:.NetFramework 3.5、C++(本机代码);

调试模式选择:托管(v4.6、v4.5、v4.0)

错误截图如下:

错误说明

仅在插件UI上执行的代码会出现这种情况。

在插件入口,到UI显示这段时间可以正常进入断点。当UI显示之后,在插件UI上操作的代码都无法进入断点,会进入无法调试的中断。

解决方案

修改外部程序配置文件(exe文件同名+.config后缀),修改启动的.NetFramework为3.5,启动调试,即可正常进入断点。

如:外部程序为:xxx.exe;配置文件则为:xxx.exe.config;

配置修改如下:

初始:

<configuration>
  <startup useLegacyV2RuntimeActivationPolicy="true">
    <supportedRuntime version="v4.0"/>
  </startup>
  <runtime><generatePublisherEvidence enabled="false"/> </runtime>
</configuration>

改为:

<?xml version="1.0"?>
<configuration>
  <startup useLegacyV2RuntimeActivationPolicy="true">
	<supportedRuntime version="v2.0.50727"/>
  </startup>
  <runtime><generatePublisherEvidence enabled="false"/> </runtime>
</configuration>



猜你喜欢

转载自blog.csdn.net/Liwuqingxin/article/details/82799288