SVN 提交时 Fxcop 检查
我可以检查任何 Fxcop 错误并阻止文件的 SVN 提交吗?无论如何,这可以做到吗?
Can I check for any Fxcop errors and block the SVN commit of file(s)? Can this be done in anyway?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这看起来肯定可以通过 Subversion 提交后挂钩。但是,如果您要签入源代码,则该挂钩将需要构建您的项目,然后在输出二进制文件上运行 FxCop。这将使提交后挂钩非常慢,并且在一切进行时您的提交似乎会挂起。
我的观点是,这种事情应该在持续集成环境中完成,而不是作为提交挂钩。
This certainly seems like it would be possible with a Subversion post-commit hook. However if you are checking in source, the hook would require building your project followed by a run of FxCop on the output binary. This would make the post-commit hook very slow and your commits would appear to hang while everything was going on.
My opinion is that this sort of thing should be done with a continuous integration environment rather than as a commit hook.
如果您使用 TortoiseSVN,则可以配置客户端预提交挂钩脚本,如 文档。
If you're using TortoiseSVN, you can configure a client-side pre-commit hook script as described in the docs.