简体   繁体   English

在本地调试TFS插件

[英]Debugging TFS plugin locally

I'm working on writing my first custom TFS plugin, but I'm having a difficult time debugging it with my local TFS installation. 我正在编写第一个自定义TFS插件,但是在使用本地TFS安装进行调试时却遇到了困难。 I've been following this tutorial to get this up and running. 我一直在按照本教程进行操作。

The plugin implements the ISubscriber interface to watch the WorkItemChangedEvent - the intent is to be able to automatically merge changesets related to a work item when said work item transitions from one state to another. 该插件实现ISubscriber接口,以监视WorkItemChangedEvent目的是当所述工作项从一种状态转换为另一种状态时,能够自动合并与工作项相关的变更集。

Currently I have the project set to output builds to C:\\Program Files\\<TFS Installation>\\Application Tier\\Web Services\\bin\\Plugins\\ , and have verified that both <ProjectName>.dll and <ProjectName>.pdb are generated in the plugins folder when I build my project - but the plugin doesn't appear in the modules panel! 目前,我已将项目设置为将生成的内容输出到C:\\Program Files\\<TFS Installation>\\Application Tier\\Web Services\\bin\\Plugins\\ ,并且已验证是否生成了<ProjectName>.dll<ProjectName>.pdb在我构建项目时在plugins文件夹中-但是该插件未出现在modules面板中! And, when I attach to the w3wp.exe process, my breakpoint starts giving me attitude: 而且,当我附加到w3wp.exe进程时,我的断点开始给我一种态度:

The breakpoint will not currently be hit. No symbols have been loaded for this document. 

I've also got a few EventLog.WriteEntry(..) statements inside the event listener, but those don't seem to be logging either, so it seems like the plugin isn't running at all - I assume for the same reason. 我在事件侦听器中也有一些EventLog.WriteEntry(..)语句,但是这些语句似乎也不在记录日志,因此看来该插件根本没有运行-我基于同样的原因。

I'm not entirely sure what would be causing this to happen, but I also haven't done much .NET coding for a couple of years, so I may be overlooking something pretty simple. 我不太确定会导致这种情况发生的原因,但是两年来我也没有做太多的.NET编码,因此我可能忽略了一些简单的事情。

Can anyone think of a reason why this would be happening? 谁能想到发生这种情况的原因? If I need to provide more info, please let me know - I'll try and be as helpful as possible! 如果我需要提供更多信息,请让我知道-我会尽力而为!

So I'm pretty sure the problem was because I had all of my build settings targeting x86 (which my dev machine - and subsequently my local TFS install - is running on). 因此,我非常确定问题是因为我有所有针对x86的构建设置(我的开发机以及随后的本地TFS安装在其上运行)。 I changed builds to target All CPUs, and that seems to have done the trick...the plugin now shows up in the list of loaded modules, connects to the debugger, and logs events. 我将构建更改为以所有CPU为目标,这似乎已经解决了问题……该插件现在显示在已加载模块的列表中,连接到调试器并记录事件。 I'm not sure why target architecture would have any affect on deployment though...but now I can start to actually build something... 我不确定为什么目标体系结构会对部署产生任何影响……但是现在我可以开始实际构建一些东西了……

TL;DR TL; DR

Be careful messing with build configs if you don't know what you're doing! 如果您不知道自己在做什么,请小心弄乱构建配置!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM