I dynamically create an instance of the class with reflection, and this works fine, except that when I try to do this with unit testing, I use the MS testing environment.
I get a familiar error: “Could not load the file or assembly“ Assy ”or one of its dependencies. The system cannot find the specified file.“
I copied the dll to the bin \ debug bin of the Unit test project - is this not the right place to put it?
string assyName = "Go.Data.SqlServer";
string typeName = "GoMolaMola.Data.SqlServer.DataProviderFactory";
Assembly assy = Assembly.Load( assyName );
object o = assy.CreateInstance( typeName );
Any ideas? I am new to unit testing and any help would be appreciated.
thanks
source
share