You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

VS2017 VB.NET项目无法加载Microsoft.DiaSymReader.Native.amd64.dll求解决

编译错误BC37225:无法加载Microsoft.DiaSymReader.Native.amd64.dll的解决方法

开发自定义沙箱化程序启动器时,编译报错BC37225:写入调试信息失败:无法加载DLL 'Microsoft.DiaSymReader.Native.amd64.dll': 找不到指定的模块。(HRESULT异常: 0x8007007E)
已通过NuGet安装该DLL,并复制到项目目录、System32目录,但问题依旧。
相关VB代码如下:

Dim Process1 As Object

<DllImport("user32.dll")> Public Shared Function SetParent(ByVal hwndChild As IntPtr, ByVal hwndNewParent As IntPtr) As Integer
End Function

Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
    Button1.Text = My.Settings.App1Name
End Sub

Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
    Process1.StartInfo.FileName = (My.Settings.App1Link)
    Process1.Start()

    Do Until Process1.WaitForInputIdle = True
        'Nothing
    Loop
    'SetParent(Process1.MainWindowHandle, Panel1.Handle)
End Sub

解决步骤

  • 确认NuGet包的正确引用与复制配置
    确保安装官方Microsoft.DiaSymReader.Native包,版本匹配你的.NET框架版本:

    1. 找到NuGet包安装目录下的目标DLL:packages\Microsoft.DiaSymReader.Native.x.x.x\runtimes\win-x64\native\Microsoft.DiaSymReader.Native.amd64.dll
    2. 将该DLL复制到项目的bin\x64\Debug或bin\x64\Release目录(对应你的编译配置)
    3. 将DLL添加为项目现有项,右键DLL→属性,设置复制到输出目录为“始终复制”
  • 统一编译平台目标
    避免32位/64位不匹配:

    1. 右键项目→属性→编译→高级编译选项
    2. 将“目标CPU”设置为x64
  • 临时禁用调试信息生成
    若需快速编译通过,可先关闭调试信息生成:

    1. 右键项目→属性→编译→高级编译选项
    2. 将“生成调试信息”设置为无
  • 修复Visual Studio组件
    该DLL是VS调试符号读取的依赖项,可能组件缺失:

    1. 打开Visual Studio安装程序→修改→单个组件
    2. 搜索“调试符号”或“Dia SymReader”,勾选对应组件并安装
  • 修正代码中的类型错误
    原代码中Process1声明为Object类型会导致运行时错误,需改为Process并实例化:

    Dim Process1 As New Process()
    
    <DllImport("user32.dll")> Public Shared Function SetParent(ByVal hwndChild As IntPtr, ByVal hwndNewParent As IntPtr) As Integer
    End Function
    
    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        Button1.Text = My.Settings.App1Name
    End Sub
    
    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        Process1.StartInfo.FileName = My.Settings.App1Link
        Process1.Start()
    
        Do Until Process1.WaitForInputIdle() = True
            ' 等待进程空闲
        Loop
        'SetParent(Process1.MainWindowHandle, Panel1.Handle)
    End Sub
    

内容的提问来源于stack exchange,提问作者chardida

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.10 22:20:46