dotnet test : Could not load type 'LogMessageHandler'

Created on 14 Oct 2016  路  7Comments  路  Source: microsoft/dotnet

Problem

Trying to run tests i got the exception below.

C:\MySolution>dotnet test project.json
Project MyProject1 (.NETStandard,Version=v1.6) was previously compiled. Skipping compilation.
Project MyProject2 (.NETStandard,Version=v1.6) was previously compiled. Skipping compilation.
Project MyProject3 (.NETStandard,Version=v1.6) was previously compiled. Skipping compilation.
Project MyProjectTest (.NETCoreApp,Version=v1.0) was previously compiled. Skipping compilation.
Discovering Tests ...
Executing Tests ...
Failed   StatusTest
Error Message:
   Exception thrown while executing test. If using extension of TestMethodAttribute then please 
contact vendor. Error message: Could not load type 'LogMessageHandler' from assembly
'Microsoft.VisualStudio.TestPlatform.TestFramework, Version=14.0.0.0, Culture=neutral, 
PublicKeyToken=b03f5f7f11d50a3a'.
============ Test Run Summary ============
Total tests: 1. Passed: 0. Failed: 1. Skipped: 0
Test Run Failed.
SUMMARY: Total: 1 targets, Passed: 0, Failed: 1.

Informations

  • dotnet version: 1.0.0-preview2-003131
  • project.json:
{
  "version": "1.0.0-*",
  "testRunner": "mstest",

  "dependencies": {
    "MSTest.TestFramework": "1.0.5-preview",
    "Microsoft.NETCore.App": {
      "type": "platform",
      "version": "1.0.1"
    },
    "MyProject1": { "target": "project" },
    "dotnet-test-mstest": "1.1.1-preview"
  },

  "frameworks": {
    "netcoreapp1.0": {
      "imports": [ "portable-net451+win8", "dnxcore50" ]
    }
  }
}

Most helpful comment

It seems that there is a problem with package "MSTest.TestFramework": "1.0.5-preview". I downgraded it to "MSTest.TestFramework": "1.0.4-preview" and tests are running fine now.

All 7 comments

It seems that there is a problem with package "MSTest.TestFramework": "1.0.5-preview". I downgraded it to "MSTest.TestFramework": "1.0.4-preview" and tests are running fine now.

For me it's working also with "1.0.4-preview".

Also seeing the same issue - error with 1.0.5 but not 1.0.4.

Also seeing the same issue with "1.0.6-preview".
This can be fixed by upgrading dotnet-test-mstest to "1.1.2-preview".

Try to add reference to MSTest.TestAdapter

thanks, update to 1.1.2-preview also worked for me

Appears resolved. Please re-activate if not.

Was this page helpful?
0 / 5 - 0 ratings