![](/img/trans.png)
[英]Debug a Managed DLL loaded by Native Application in Visual Studio 2015
[英]How can I debug dll if loaded in advance using visual studio 2015
我正在开发一个WPF应用程序。 我正在用BootLoader方法预先加载所有dll。 当我在我的dll之一中放置断点时。 我无法调试,断点没有命中,断点似乎也没有被禁用。
所有选项均正确。 甚至模块选项卡显示已加载符号,并且程序集的pdb文件位于相同位置
private readonly ConcurrentDictionary<string, Assembly> _libs;
public App()
{
_libs = new ConcurrentDictionary<string, Assembly>();
BootLoader();
}
private void BootLoader()
{
Assembly a;
foreach (var dll in new DirectoryInfo(System.AppDomain.CurrentDomain.BaseDirectory + @"\..\..\").GetFiles("*.dll", SearchOption.AllDirectories))
{
if (!_libs.TryGetValue(dll.Name, out a))
{
if (!_libs.TryAdd(dll.Name, Assembly.LoadFile(dll.FullName)))
{
Logger.Error($"CurrentDomain_AssemblyResolve: could not add {dll.Name} in assembly list");
}
}
}
请协助。
确保每个程序集的pdb文件位于同一位置。
当我们开始在Visual Studio中调试应用程序时,Visual Studio将尝试在所有断点命中之前加载所有程序集符号文件。 因此,您的问题与符号文件的加载无关。
当您第一次开始调试时,请确保您处于Debug模式 ,而不是Release模式。 并且根据您提供的示例代码,BootLoader()方法中有任何条件。 请确保添加的断点满足If条件语句或条件语句块之外的条件。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.