Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unit Testing Error - "Unable to get type" "Error: Could not load type" "from assembly"

I am getting this error with my new unit test:

Unable to get type MyTestProject.MyTestClass, MyTestProject. Error: Could not load type 'MyTestProject.MyTestClass' from assembly 'MyTestProject'..

I have other tests in the project that were working just fine and now they are all showing a similar error message.

If I run the test in Resharper (rather than the built in Visual Studio Test runner) then it works fine. (I would just use that, but it is slower.)

Any idea what this could mean?

like image 377
Vaccano Avatar asked Mar 05 '10 18:03

Vaccano


1 Answers

It's also happens when library under test is in GAC. It's offen case when you develop for SharePoint.

Remove library from GAC if you don't need it there or deploy newest version to GAC.

like image 187
Sebastian.Belczyk Avatar answered Sep 29 '22 04:09

Sebastian.Belczyk