MSTest.exe没有找到的app.config [英] MSTest.exe not finding app.config

查看:578
本文介绍了MSTest.exe没有找到的app.config的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

目前,我试图从NCover运行MSTest.exe,但我相信问题可以普遍适用于在命令行中运行MSTest.exe。

I'm currently trying to run MSTest.exe from NCover, but I believe the question could apply generally to running MSTest.exe from the command line.

如果我有/ noisolation的说法,那么MSTest.exe似乎找到并使用在app.config预期。没有它,NCover没有捕捉到任何覆盖信息。从我的研究,到目前为止,似乎NCover需要/ noisolation。所以,问题是如何获得时的参数传递我的* .config文件的工作。

If I have the "/noisolation" argument, then MSTest.exe appears to find and use the app.config as expected. Without it, NCover doesn't capture any coverage information. From my research so far, it seems NCover needs /noisolation. So the question is how to get my *.config files to work when that argument is passed.

我NCover设置为:

My NCover settings are:

应用简介
C:\ Program Files文件(x86)的\微软的Visual Studio 9.0 \ Common7 \ IDE \ MSTest.exe

Application to Profile
C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE\MSTest.exe

工作文件夹
C:\ Documents和Settings \我的资料\我的文档\ Visual Studio 2008的\项目\某某\ XYZ.CoreTest \斌\调试

Working Folder
C:\Documents and Settings\MyProfile\My Documents\Visual Studio 2008\Projects\XYZ\XYZ.CoreTest\bin\Debug

应用程序参数
/ noisolation / testcontainer:C:\ Documents和Settings \我的资料\我的文档\ Visual Studio 2008的\项目\某某\ XYZ.CoreTest \斌\调试\ XYZ.CoreTest.dll

Application arguments
/noisolation /testcontainer:"C:\Documents and Settings\MyProfile\My Documents\Visual Studio 2008\Projects\XYZ\XYZ.CoreTest\bin\Debug\XYZ.CoreTest.dll"



更新:我添加了一个跟踪显示,我的配置是(不奇怪)尝试读取C:\ Program Files文件(x86)的\微软的Visual Studio 9.0 \ Common7 \ IDE \ MSTest.exe.Config。



Update: I added a trace showing that my config is (not surprisingly) trying to read from "C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE\MSTest.exe.Config".

更新2:如果有可能,我不希望编辑MSTest.exe.Config。这只是是不是非常便携。

Update 2: If at all possible, I don't want to edit MSTest.exe.Config. That just isn't terribly portable.

推荐答案

从克雷格斯顿茨的评论在<一个href="http://devlicio.us/blogs/derik_whittaker/archive/2008/07/23/mstest-why-i-hate-you-you-cause-me-too-much-friction.aspx">link文字

From Craig Stuntz in a comment at link text

如何使用MSTest的做到这一点。

How to do this with MSTest.

  1. 在Solution Explorer中,用鼠标右键单击该解决方案(而不是项目)。

  1. In Solution Explorer, right-click the Solution (not the Project).

点击添加,新项

在类别中,选择测试运行配置

In Categories, select Test Run Configuration

现在选择的测试运行配置项,并将其添加到您的项目

Now choose the Test Run Configuration item and add it to your project

在Solution Explorer中,双击您刚刚创建的测试运行配置

In Solution Explorer, double-click the Test Run Configuration you just created

点击部署项目

添加您的配置文件作为部署的文件(或部署包含它的整个文件夹,如果合适的话)

Add your config file as a deployed file (or deploy the entire folder which contains it, if appropriate)

这我花了一些时间来弄清楚,但我在类似的情况,它确实为我工作。

This took me a little while to figure out, but I'm in a similar situation and it does work for me.

这篇关于MSTest.exe没有找到的app.config的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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