Visual studio Visual Studio 2013单元测试错误:无法加载Microsoft.VisualStudio.TestPlatform.ObjectModel.dll

Visual studio Visual Studio 2013单元测试错误:无法加载Microsoft.VisualStudio.TestPlatform.ObjectModel.dll,visual-studio,unit-testing,Visual Studio,Unit Testing,由于某种原因,VS 2013(更新3)中的测试项目中的单元测试没有出现 Could not load file or assembly 'file:///C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO 12.0\ COMMON7\IDE\COMMONEXTENSIONS\MICROSOFT\TESTWINDOW\ Microsoft.VisualStudio.TestPlatform.ObjectModel.dll' or one of its

由于某种原因,VS 2013(更新3)中的测试项目中的单元测试没有出现

Could not load file or assembly 
'file:///C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO 12.0\
COMMON7\IDE\COMMONEXTENSIONS\MICROSOFT\TESTWINDOW\
Microsoft.VisualStudio.TestPlatform.ObjectModel.dll' 
or one of its dependencies. Unspecified error (Exception 
from HRESULT: 0x80004005 (E_FAIL))```
检查文件夹时,文件就在那里


我在同一个解决方案中的另一个项目中的Chutzpah测试也显示了出来。搜索时找不到有关此错误的详细信息。任何人都有类似的问题,或者知道如何解决这个问题?

经过几个小时的反复尝试,出于某种原因,我注意到测试项目中有一个app.config文件。删除该文件有效:)

经过数小时的反复尝试,出于某种原因,我注意到测试项目中有一个app.config文件。删除此选项有效:)

在我的例子中,我注意到在测试项目的app.config文件中,有多个assemblyIdentity作为标记的一部分包含在其中,不应该被删除

配置不正确

<dependentAssembly>
<assemblyIdentity name="WindowsAzureTelemetryEvents" publicKeyToken="31BF3856AD364E35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.4.0.0" newVersion="2.4.0.0" />
<assemblyIdentity name="WindowsAzureEventSource" publicKeyToken="31BF3856AD364E35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.4.0.0" newVersion="2.4.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="WindowsAzureTelemetryEvents" publicKeyToken="31BF3856AD364E35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.4.0.0" newVersion="2.4.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="WindowsAzureEventSource" publicKeyToken="31BF3856AD364E35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.4.0.0" newVersion="2.4.0.0" />
</dependentAssembly>

正确配置

<dependentAssembly>
<assemblyIdentity name="WindowsAzureTelemetryEvents" publicKeyToken="31BF3856AD364E35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.4.0.0" newVersion="2.4.0.0" />
<assemblyIdentity name="WindowsAzureEventSource" publicKeyToken="31BF3856AD364E35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.4.0.0" newVersion="2.4.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="WindowsAzureTelemetryEvents" publicKeyToken="31BF3856AD364E35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.4.0.0" newVersion="2.4.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="WindowsAzureEventSource" publicKeyToken="31BF3856AD364E35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.4.0.0" newVersion="2.4.0.0" />
</dependentAssembly>

在我的例子中,我注意到在测试项目的app.config文件中,有不止一个assemblyIdentity作为标记的一部分包含在其中,不应该包含在其中

配置不正确

<dependentAssembly>
<assemblyIdentity name="WindowsAzureTelemetryEvents" publicKeyToken="31BF3856AD364E35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.4.0.0" newVersion="2.4.0.0" />
<assemblyIdentity name="WindowsAzureEventSource" publicKeyToken="31BF3856AD364E35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.4.0.0" newVersion="2.4.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="WindowsAzureTelemetryEvents" publicKeyToken="31BF3856AD364E35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.4.0.0" newVersion="2.4.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="WindowsAzureEventSource" publicKeyToken="31BF3856AD364E35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.4.0.0" newVersion="2.4.0.0" />
</dependentAssembly>

正确配置

<dependentAssembly>
<assemblyIdentity name="WindowsAzureTelemetryEvents" publicKeyToken="31BF3856AD364E35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.4.0.0" newVersion="2.4.0.0" />
<assemblyIdentity name="WindowsAzureEventSource" publicKeyToken="31BF3856AD364E35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.4.0.0" newVersion="2.4.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="WindowsAzureTelemetryEvents" publicKeyToken="31BF3856AD364E35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.4.0.0" newVersion="2.4.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="WindowsAzureEventSource" publicKeyToken="31BF3856AD364E35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.4.0.0" newVersion="2.4.0.0" />
</dependentAssembly>


相关答案:我试图聪明地使用XML指令thingey注释掉app.config中包含其他注释的大部分内容。不要在app.config中使用
指令。

相关回答:我试图聪明地使用XML指令thingey注释掉app.config中包含其他注释的大部分。不要在app.config中使用
指令。

这很奇怪。如果你认为它与该项目的内容有关,你可以在上提交一个问题,并包括一个重新制作该问题的项目。这很奇怪。如果你认为它与该项目的内容有关,你可以在上提交一个问题,并包括一个重新制作该问题的项目。天哪,你刚刚救了我的命。这个问题让我头痛不已,非常感谢。是的。对我来说,这恰好是不正确的跨分支自动合并问题。很高兴看到这篇文章至少帮助了一些人。哦,伙计,经过2天的调试,这就是问题所在。谢谢你发布这个。啊,啊,你刚刚救了我的命。这个问题让我头痛不已,非常感谢。是的。对我来说,这恰好是不正确的跨分支自动合并问题。很高兴看到这篇文章至少帮助了一些人。哦,伙计,经过2天的调试,这就是问题所在。谢谢你发布这个。啊啊啊