无法在 VS 2012 中使用 Code Rush 运行ner 进行 运行 xUnit 测试,无一例外

Unable to run xUnit Test with Code Rush runner in VS 2012 without an exception

当我在 VS2012 中使用 DevExpress 创建单元测试项目时,它立即失败,Microsoft.VisualStudio.TestPlatform.Core 中出现异常。添加 Assert 以便 Sub 实际上执行某些操作无济于事。该项目没有多少 building/rebuilding 帮助,重新加载 DevExpress 也没有帮助。代码很简单:

<TestClass()> Public Class UnitTest1
    <TestMethod()> Public Sub TestMethod1()
        Assert.IsTrue(True)
    End Sub
End Class

我猜有些东西配置错误,但我不知道是什么。异常和完整输出如下。

Testing started:  

Total tests: 1, filtered: 1  

Exception:  
Message: An error occurred while initializing the settings provider named 'RunConfiguration'.  
Error: Invalid settings 'RunConfiguration'. Unexpected XmlElement: 'SolutionDirectory'.  
Source: Microsoft.VisualStudio.TestPlatform.Core  
StackTrace:  
    at Microsoft.VisualStudio.TestPlatform.Core.RunSettings.<>c__DisplayClass2.<CreateLazyThrower>b__1()  
    at Microsoft.VisualStudio.TestPlatform.Core.TestPluginsFramework.LazyExtension`2.get_Value()  
    at Microsoft.VisualStudio.TestPlatform.Core.RunSettings.GetSettings(String settingsName)  
    at CR_VSTesting.Executor.Run(ExecuteTestData data, RunSettings settings, IEnumerable`1 testCases)  
    at CR_VSTesting.Executor.Execute(ExecuteTestData data)  
InnerException:  
Exception:  
Message: Invalid settings 'RunConfiguration'. Unexpected XmlElement: 'SolutionDirectory'.  
Source: Microsoft.VisualStudio.TestPlatform.ObjectModel  
StackTrace:  
    at Microsoft.VisualStudio.TestPlatform.ObjectModel.RunConfiguration.FromXml(XmlReader reader)  
    at Microsoft.VisualStudio.TestPlatform.Extensions.RunConfigurationSettingsProvider.Load(XmlReader reader)  
    at Microsoft.VisualStudio.TestPlatform.Core.RunSettings.LoadSection(XmlReader reader, SettingsProviderExtensionManager settingsExtensionManager, Boolean reload)  
No tests found.  
Duration : 0.8022362  

CodeRush v14.2.6.0 中的某些内容似乎与 Visual Studio 2012 版冲突。我确认这在 2013 年工作正常。禁用 CodeRush 中的单元测试功能解决了该问题。要禁用此功能,请转至 DEVEXPRESS > 选项... > 单元测试,然后取消选中 "Enable Unit Tests Service" 复选框。