I am trying to test my custom membership provider using MSTest in VS2010, but keep getting an error System.TypeLoadException: Could not load type 'TafAdris.Security.TafAdrisMembershipProvider' from assembly 'TafAdrisSecurity'.
After a lot of struggling, I realized that MSTest cannot find my assembly even though I specified Copy Local in the References folder. Next I tried debugging the unit test and in the Watch window I type Environment.CurrentDirectory. I get the following folder:
C:\Users\XYZ\Documents\Visual Studio 2010\Projects\CustomSecurityProviderApp\TestResults\XYZ_PCNAME 2011-10-11 18_24_55\Out
But the Test project output folder is specified in a totally different location. Has anyone had a similar issue? Do you know how to force MSTest to load DLL from a specific location?
I tried specifying additional folders in Test Settings -> Unit Test but that seems to be ignored.
OK, I solved this. This is the solution:
This caused test to run in the specified directory where my custom membership is located.