【问题标题】:Are there any xsd schemas available for the .runsettings file in Visual Studio 2012 unit tests?Visual Studio 2012 单元测试中的 .runsettings 文件是否有可用的 xsd 架构?
【发布时间】:2012-10-07 08:43:51
【问题描述】:

根据这篇 msdn 文章 http://msdn.microsoft.com/en-us/library/jj635153.aspx,在 Visual Studio 2012 中,您需要使用名为 .runsettings 的 xml 文件来配置您的部署、代码覆盖率、框架设置等。

乍一看,这看起来很棒,因为您可以从任何测试适配器挂钩适配器设置,例如NUnit、MSTest、MBUnit 等。但是在我安装的 Visual Studio 2012 Premium 中,没有用于创建此文件的 xsd 架构,但 VS2010 .testsettings 文件当然有旧架构。 (xmlns="http://microsoft.com/schemas/VisualStudio/TeamTest/2010" 又名 %programfiles%\Microsoft Visual Studio 11.0\Xml\Schemas\vstst.xsd)

除了上面链接中的示例之外,还有其他人可以创建运行设置文件吗?

您是否还找到了如何从 .runsettings 文件中引用旧版 VS2010 .testsettings 文件,因为在“SettingsFile”节点中没有具体说明它应该是相对的还是绝对的?

【问题讨论】:

    标签: unit-testing configuration xsd visual-studio-2012 mstest


    【解决方案1】:

    我们还没有 .runsettings 文件的公共 xsd。

    从 .runsettings 引用 .testsettings 文件的方法如下所示。您可以使用此文件的绝对路径和相对路径。

    <RunSettings> <MSTest> <SettingsFile>my.testsettings</SettingsFile> <ForcedLegacyMode>true</ForcedLegacyMode> </MSTest> </RunSettings>

    【讨论】:

      猜你喜欢
      • 2012-11-29
      • 2013-01-16
      • 2013-08-22
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多