Visual Studio集成自定义MSBuild任务行为 [英] Visual Studio integrated custom MSBuild task behaviour

查看:80
本文介绍了Visual Studio集成自定义MSBuild任务行为的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在网上寻找NUnit自定义MSBuild任务,该任务将在每个构建版本上运行,并且还可以很好地与Visual Studio UI配合使用(2008版).我找到了很棒的MSBuild.Community.Tasks项目,但是在Visual Studio集成部分失败了. 我真正想要拥有的是在VS的错误列表窗口中将失败的测试显示为警告/错误(以及在测试不成功时也会生成FAILED项目).因此,我编写了自己的自定义MSBuild任务,该任务完全按照我的期望来完成.

I was looking around the net for a NUnit custom MSBuild task that would run on every build and also nicely play with Visual Studio UI (2008 is my version). I found MSBuild.Community.Tasks project that was great, but failed in Visual Studio integration part. What I actually wanted to have is get failed tests displayed as warnings/errors in VS's error list window (and also FAILED project build when tests are not successful). So I wrote my own custom MSBuild task that does the job exactly how I wanted it to be.

但是.

我唯一的问题是,正常的VS UI错误列表行为是,当您单击错误时,它会跳到适当的源文件,并突出显示有问题的代码.我能够将文件和行号与失败的测试相关联,但是我无法以任何方式说服Visual Studio使用HIGHLIGHT有问题的代码(当我双击错误时).我所得到的只是将光标放在正确的位置. 我尝试了lineendLinecolumnendColumn方法参数(Log.LogError())的各种组合,但均无济于事.而且,根据编译器错误输出的错误,看起来它还只提供了行和列(没有结束值).

The only problem that I have is that normal VS UI error list behaviour is that when you click on an error it jumps to appropriate source file and highlights the problematic code. I was able to relate file and line number with failed test however I wasn't able in any way to persuade Visual Studio to HIGHLIGHT problematic code for me (when I double click the error). All I get is cursor in the right spot. I tried all kinds of combinations of line, endLine, column, endColumn method parameters (Log.LogError()), but to no avail. And based on error output by compiler errors it looks like it also provides just line and column (no end values).

有人遇到这种奇怪的问题并解决了吗?

Anybody ran against this oddity and solved it?

更新2009年5月13日
您可以在
免费获得该项目(无需选择方法) http://code.google.com/p/nunitmsbuildvsintegrated/

Update 13 May 2009
You can get this project for free (without method selection) at
http://code.google.com/p/nunitmsbuildvsintegrated/

推荐答案

为此功能,您必须创建在Visual Studio中显示自定义面板的Visual Studio集成包.构建项目时将调用此自定义面板.

For this feature, you must create Visual Studio Integrated Package that display custom panel in Visual Studio. This custom panel will be called when your project is built.

Visual Studio可扩展性开发人员中心

这篇关于Visual Studio集成自定义MSBuild任务行为的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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