views:

139

answers:

2

Hi, i have a website and in it is an application with website administration.

It is possible to load an assembly from website in administration application?

E.G:

alt text

WebAdmin project (web application) : in default.aspx i want to load assembly ClassLibrary1.dll and create instance of type ImportProvider. WebAdmin doesn't have reference to ClassLibrary1.

Configuration in IIS:

alt text

Application directory "admin" (WebAdmin project) is in Website1

Thanks a lot

A: 

Im sure what your asking is possible but im a bit confused.

Could you be more specific on what your problem is.

Morten Anderson
I have one administration for more websites and each website is using different import/export providers and other things. So i can't add reference directly to admin project
Jan Remunda
I still am not sure what you want and what your specific problem is. However it seems like you should make your admin application support the different types of websites you have.
Morten Anderson
i added a picture with description
Jan Remunda
+1  A: 

Hi, I have exactly the same situation.

Create an interface IImportProvider. Your websites have to create its own class libraries that implement that interface(each website has different provider). Now you have a \website\bin\ directory with specific classLibrary.dll for each website that implements IImportProvider.

Now you can use MEF in your administration to load the assembly classLibrary.dll. This works for me.

mynkow
Thanks, MEF is great.
Jan Remunda