0

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

Community
  • 1
  • 1
Jan Remunda
  • 7,840
  • 8
  • 51
  • 60
  • Is there a reason you can't just add a reference to it? – peppy Mar 12 '10 at 10:01
  • I have one admin project for many websites and each website has its own specific providers. – Jan Remunda Mar 12 '10 at 10:05
  • You will need to have a reference to the project in there. If I understand what you are trying to do (which I'm not sure I do), you can try setting the reference to not require a "specific version", then drop a different version of the DLL in there later. If you have multiple solutions all calling on the WebAdmin project, this should also be suitable (the reference will update to the local ClassLibrary1 project, I think). That said, it seems like an odd way to structure your project. – peppy Mar 12 '10 at 10:14

1 Answers1

1

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
  • 4,408
  • 4
  • 38
  • 65