调试 SharePoint 2007 代码 [英] Debugging SharePoint 2007 Code

查看:18
本文介绍了调试 SharePoint 2007 代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何调试 SharePoint 2007 代码?由于 SharePoint 在远程服务器上运行,并且我正在 Windows xp 机器上进行开发(将必要的 .dll 文件复制到我的 GAC 中),我在找到简单的调试方法方面运气不佳.断点不起作用等

How do you debug your SharePoint 2007 code? Since SharePoint runs on a remote server, and I'm developing on a windows xp machine (with the necessary .dll files copied into my GAC), I haven't had much luck with finding easy ways to debug. Breakpoints don't work, etc.

我想出的最好方法是在 web.config 文件中启用页面跟踪,在我的代码中写入跟踪消息,并在需要调试时访问 trace.axd.

The best way I've come up with is to enable page tracing in the web.config file, write trace messages throughout my code, and access trace.axd whenever I need to debug.

有没有人有更好的调试建议?我错过了什么吗?

Does anyone have any better suggestions for debugging? Am I missing something?

推荐答案

来自 Andrew Connell 关于该主题的博文:

将调试器附加到 GAC'd程序集:为什么我的断点不是被击中了?!?!"曾经去过那里?我太......这是多么好的皮塔饼啊!什么是继续?嗯,大会在GAC 和 Visual Studio 调试器看不到调试符号(又名:*.pdb).除非您经历了设置符号存储的麻烦你所有的 PDB 都去哪里了,你会需要把调试符号放进去与装配体相同的位置.这技巧是找到那个文件夹在 GAC 中包含您的 DLL.

Attaching the debugger to GAC'd assemblies: "Why aren't my breakpoints being hit?!?!" Ever been there? Me too... what a PITA that is! What's going on? Well, the assemblies are in the GAC and the Visual Studio debugger can't see the debugging symbols (aka: *.pdb). Unless you've gone through the trouble of setting up a symbol store where all your PDBs are going, you'll need to put the debugging symbols in the same location as the assembly. The trick is finding the folder that contains your DLL in the GAC.

c:windowsassembly 文件夹不是一个真正的文件夹,它是一个虚拟文件夹.要进入 REAL 文件夹,请执行以下:

The c:windowsassembly folder is not a real folder, it's a virtual folder. To get to the REAL folder, do the following:

  • 开始 » 运行
  • %systemroot%assemblygac[输入]

这将打开 GAC 文件夹.现在,四处看看,直到找到一个看起来像这样的文件夹(你可能需要跳上一个文件夹然后下潜进入 MSIL 文件夹):[程序集文件名称 -.DLL 扩展名][程序集版本格式为> #.#.#.#]__[程序集公钥令牌].

This will open the GAC folder. Now, poke around until you find a folder that looks like this (you might need to jump up one folder and dive into the MSIL folder): [assembly file name -.DLL extention][assembly version in format of > #.#.#.#]__[assembly public key token].

找到那个文件夹后,打开它你会看到你的程序集.复制PDB 文件到该文件夹​​,然后附加调试器进行一些调试快乐!

When you find that folder, open it up and you'll see your assembly. Copy the PDB file to that folder and then attach the debugger for some debugging joy!

这篇关于调试 SharePoint 2007 代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆