gpt4 book ai didi

sharepoint - 调试 SharePoint 2007 代码

转载 作者:行者123 更新时间:2023-12-04 17:29:31 25 4
gpt4 key购买 nike

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

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

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

最佳答案

来自 Andrew Connell's blog post就此主题而言:

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.

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

  • Start » Run
  • %systemroot%\assembly\gac [ENTER]

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].

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 - 调试 SharePoint 2007 代码,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/145361/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com