Specify Assembly Location RRS feed

  • Question

  • I am developing an application that has the majority of the user screens in external assemblies, an extension, which are loaded by a host process at run time exposing the functionality to the users. 

    The logic behind the setup is that the domain logic stays fairly static but the way the user interacts with it may change frequently so having the ability to simply xcopy an assembly into the extenstions folder removes a large headache of having to constantly deploy the app.

    Issue I have is I really want to have the domain logic and data layers in there own folders rather than having to put it all in the same folder, and don't want to use the GAC as seems to be overkill for what should be a simple problem.

    My folder structure is:

    Application   - where host app sits
        --> Extensions  - where external assemblies sit
        --> Domain Model - where all domain logic is located
        --> Data   - where data layer sits

    I have attempted to use the codebase and probing settings but it hasn't worked.  Whenever the host tries to load an extension it complains because it cannot find the domain model.

    I have tried putting the configuration settings in the host config file, I even created config files for the extenstions, I used relative paths and absolute paths.

    The extensions are currently loaded using Assembly.LoadFromFile and then Activator.CreateInstance to create an instance of the class or classes required.

    Can anybody point me in the right direction?
    Friday, June 15, 2007 8:17 PM


  • You can help the CLR find the assembly by implementing the AppDomain.AssemblyResolve event.
    Wednesday, June 20, 2007 6:50 PM