你可以只用源$ C ​​$一个文件了C调试.NET应用程序?你可以、应用程序、文件、NET

2023-09-03 05:33:26 作者:20.twinge(刺痛)

我要调试在Visual Studio中的应用程序,但我只有源$ C ​​$ C为1级。我只需要逐步完成在该文件中单一的功能,但我不明白我需要做的。我想的步骤通常是这样的:

I want to debug an application in Visual Studio but I ONLY have the source code for 1 class. I only need to step through a single function in that file, but I don't understand what I need to do it. I think the steps are normally something like this:

在VS打开文件 装载在符号(.PDB文件) 附加到正在运行的进程

我知道该怎么做#1和#3,但我也不怎么办#2没有.PDB文件。是否有可能生成.PDB文件这使它工作?谢谢!

I know how to do #1 and #3, but I don't how to do #2 without the .PDB file. Is it possible to generate the .PDB file for this to make it work? Thanks!

推荐答案

您需要的* .pdb文件(从您的帖子步骤2),这些文件包含的源$ C ​​$ c和编译的程序集的映射。所以,你的步骤是正确的。如果源文件具有与原文件的差异,设定对号允许源$ C ​​$ C是从原来的版本不同的BP的属性对话框。

You need *.pdb files (step 2 from your post) These files contain mapping between source code and compiled assembly. So your step are correct. If your source file has differences with original file, set check mark "Allow the source code to be different from the original version" in BP's properties dialog.

断点和跟踪在Visual Studio

如果您还没有PDB文件,你可以尝试使用反编译你的项目 Reflector.FileDisassembler 或 FileGenerator对于反射。他们可以重新编译这些文件以获得PDBS

If you don't have PDB files you can try to decompile your project using Reflector.FileDisassembler or FileGenerator For Reflector. They you can recompile these files to get PDBs

另外一起来看看 Deblector - 调试插件的反射

Also take a look at Deblector - debugging addin for Reflector.