该项目是使用 kriasoft 的 amibroker .NET SDK 用 C# 开发的“amibroker 插件”。
我已经“构建”了我的插件,当我在“控制台项目”中测试它时它工作正常。但是,当我尝试使用外部应用程序 (Amibroker.exe) 调试它时,Visual Studio 突然关闭,并在几秒钟内启动一个空白的 Visual Studio 窗口,其中包含“附加”选项来代替我们通常看到的“开始”运行我们的项目。
我单击附加选项并附加到我的 amibroker 应用程序,它成功显示“Debug.Writeline()”消息。但是我的断点都没有被击中。我的代码在任何窗口中都不可见,就像我调试控制台应用程序时通常那样。
在谷歌研究后,我发现外部应用程序应该由 Visual Studio 自动启动,并且应该在我的断点处停止。这在我的情况下没有发生。我搜索了很多,甚至更新了整个vs2019,但没有任何进展。
如果有人可以帮助我,那就太好了。
注意:“不调试就开始”工作正常。
关于“无法加载文件或程序集'System.Text.Json”的新信息:无法加载文件或程序集'System.Text.Json,版本=4.0.1.1,文化=中性,PublicKeyToken=cc7b13ffcd2ddd51'或其依赖项之一. 该系统找不到指定的文件。
错误:510 LOG:DisplayName = System.Text.Json,Version=4.0.1.1,Culture=neutral,PublicKeyToken=cc7b13ffcd2ddd51(完全指定) LOG:Appbase = file:///C:/Program Files (x86)/AmiBroker_New_6 .0/ LOG:初始 PrivatePath = NULL 调用程序集:(未知)。Err:510 LOG:此绑定在默认加载上下文中启动。LOG:未找到应用程序配置文件。LOG:使用主机配置文件: LOG:使用来自 C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config 的机器配置文件。日志:后策略参考:System.Text.Json,版本=4.0.1.1,文化=中性,PublicKeyToken=cc7b13ffcd2ddd51 日志:尝试下载新 URL 文件:///C:/Program Files (x86)/AmiBroker_New_6.0 /System.Text.Json.DLL。日志:正在尝试下载新的 URL 文件:///C:/Program Files (x86)/AmiBroker_New_6.0/System.Text.Json/System.Text.Json.DLL。日志:正在尝试下载新的 URL file:///C:/Program Files (x86)/AmiBroker_New_6.0/System.Text.Json.EXE。日志:正在尝试下载新的 URL 文件:///C:/Program Files (x86)/AmiBroker_New_6.0/System.Text.Json/System.Text.Json.EXE。
我的 packages.config 条目:
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="CsvTextFieldParser" version="1.2.1" targetFramework="net461" />
<package id="Microsoft.Bcl.AsyncInterfaces" version="1.1.0" targetFramework="net461" />
<package id="System.Buffers" version="4.5.1" targetFramework="net461" />
<package id="System.Memory" version="4.5.4" targetFramework="net461" />
<package id="System.Numerics.Vectors" version="4.5.0" targetFramework="net461" />
<package id="System.Runtime.CompilerServices.Unsafe" version="4.7.1" targetFramework="net461" />
<package id="System.Text.Encodings.Web" version="4.7.1" targetFramework="net461" />
<package id="System.Text.Json" version="4.7.1" targetFramework="net461" />
<package id="System.Threading.Tasks.Extensions" version="4.5.4" targetFramework="net461" />
<package id="System.ValueTuple" version="4.5.0" targetFramework="net461" />
<package id="UnmanagedExports" version="1.2.7" targetFramework="net461" />
</packages>
应用程序配置
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<probing privatePath="ghyiouys\;Plugins\;plugins;"/>
<dependentAssembly>
<assemblyIdentity name="System.Text.Json" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.1.1" newVersion="4.0.1.1" />
<codeBase version="4.0.1.1" href="Plugins/System.Text.Json.dll"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Numerics.Vectors" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.1.4.0" newVersion="4.1.4.0" />
<codeBase version="4.1.4.0" href="Plugins/System.Numerics.Vectors.dll"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.6.0" newVersion="4.0.6.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Buffers" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.ValueTuple" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>