i have a solution with the following Structure:
project.Model
project.Builder
project.Unit Tests
in the builder project it should create a Model instance using MEF. so in the Builder class constructor i want it to have a container to hold the parts related to building the model only(as a separation of concerns) .
currently i am using the directory catalog as follows:
var path = Environment.CurrentDirectory;
var catalog = new DirectoryCatalog(path + @"\Builder\bin\Debug");
so that in the unit test project i can use this container in writing the unit tests functions. is there a better way to make the builder container have only the dlls that resides in the builder project output directory (bin\debug). I have tried using:
var directory = System.IO.Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
var catalog = new DirectoryCatalog(directory);
bu this have make the catalog to scan the output directory of the unit tests projects which have made a lot of problems other than being not where I want the catalog to scan.
is there a more correct way than what I'm currently doing ? thanks in advance.