olemarius
olemarius

Reputation: 1134

Visual Studio 2013 Unit Test error: Could not load Microsoft.VisualStudio.TestPlatform.ObjectModel.dll

For some reason the unit tests from a test project in VS 2013 (w/Update 3) doesn't show up.

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))```

When checking the folder, the file is there.

My Chutzpah tests in another project in the same solution shows up. Couldn't find much info on this error when searching. Anyone had similar issues or know how to resolve this?

Upvotes: 0

Views: 3884

Answers (3)

No Refunds No Returns
No Refunds No Returns

Reputation: 8346

Related answer: I was trying to be clever and use the XML directive thingey to comment out large sections of app.config that included other comments. Don't use <?... ?> directives in app.config.

Upvotes: 0

In my case , I have noticed in the Test Project's app.config file, that more than one assemblyIdentity where enclosed as part of tag, which should not be.

Improper configuration

<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>

Proper Configuration

<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>

Upvotes: 6

olemarius
olemarius

Reputation: 1134

After hours of trial and error, I noticed there was a app.config file in the test project for some reason. Removing this worked :)

Upvotes: 1

Related Questions