.net - 调试:可以在我构建控制台应用程序时加载符号,但不能在我的应用程序附加到进程时加载
问题描述
我想调试附加到进程的应用程序。
我已经有一个在调试模式下构建 dll 的命令。
启动.json:
{
"version": "0.2.0",
"configurations": [
{
"name": ".NET Core Launch (console)",
"type": "coreclr",
"request": "launch",
//"preLaunchTask": "build",
"program": "${workspaceFolder}/src/N3P.Revit/bin/Debug/net472/N3P.Revit.dll",
"args": [],
"cwd": "${workspaceFolder}/src/N3P.Revit/bin/Debug/net472",
"console": "internalConsole",
"stopAtEntry": false
},
{
"name": ".NET Core Attach",
"type": "coreclr",
"request": "attach",
//"processId": "29856"
"processName": "Revit.exe"
}
]
}
任务.json:
{
"version": "2.0.0",
"tasks": [
//{
// "label": "build",
// "command": "dotnet", //do nothing
// "type": "process",
// "problemMatcher": "$msCompile",
// "args": [ //do nothing
// "--info"]
//},
{
"label": "publish",
"command": "dotnet",
"type": "process",
"args": [
"publish",
"${workspaceFolder}/src/N3P.Revit/N3P.Revit.csproj",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary"
],
"problemMatcher": "$msCompile"
},
{
"label": "watch",
"command": "dotnet",
"type": "process",
"args": [
"watch",
"run",
"${workspaceFolder}/src/N3P.Revit/N3P.Revit.csproj",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary"
],
"problemMatcher": "$msCompile"
}
]
}
项目.deps.json:
{
"runtimeTarget": {
"name": ".NETCoreApp,Version=v4.7.2",
"signature": ""
},
"compilationOptions": {},
"targets": {
".NETCoreApp,Version=v4.7.2": {
"Revit_plug_in/1.0.0": {
"runtime": {
"N3P.Revit.dll": {}
}
}
}
},
"libraries": {}
}
当我单击 .NET Core 启动(控制台)时:
已加载“C:\Program Files\dotnet\shared\Microsoft.NETCore.App\5.0.4\System.Private.CoreLib.dll”。跳过加载符号。模块已优化,调试器选项“仅我的代码”已启用。已加载“C:\Users\user040\Project\neulandt.n3p.revit\src\N3P.Revit\bin\Debug\net472\N3P.Revit.dll”。已加载符号。程序“[24376] N3P.Revit.dll”已退出,代码为 -532462766 (0xe0434352)
符号已加载,但正如预期的那样,它无法运行,因为它是一个 dll。
当我点击 .Net Core Attach 时:
没有问题,但未加载符号
解决方案
推荐阅读
- javascript - 如何允许在 Chart.js 工具提示中复制文本?
- php - Illuminate\Http\Response 类的对象无法转换为 int
- docker - 使用 docker-compose 构建多阶段 Dockerfile 时如何保留所有工件?
- angular - 使用 App_Initializer 从 .json 文件在运行时角度加载配置变量
- python-3.x - 提高具有多个条件的 Pandas 子集/过滤器的性能
- reactjs - 折线图上没有渲染注释线
- python - 接受整数或整数列表的 Python 函数
- report - 具有汇总值的 BIRT 报告图表
- java - Selenium 在 Java 中找不到元素
- mysql - 在 phpmyadmin 中创建数据集的实时副本