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

查看:181
本文介绍了调试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
程序集:为什么我的断点
被击中?曾经在那里我的b $ b也是...什么是PITA!什么是
继续?那么程序集是
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:\windows\assembly文件夹不是
a真正的文件夹,它是一个虚拟文件夹。
要访问REAL文件夹,请执行以下

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


  • 开始»运行

  • %systemroot%\assembly\gac
    [ENTER]

这将打开GAC文件夹。
现在,直到找到一个看起来像这样的
文件夹(您可能需要
需要跳转一个文件夹并将
潜入MSIL文件夹):[assembly file
name -.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文件复制到该文件夹​​,然后
附加调试器进行一些调试
joy!

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天全站免登陆