Question

I'm writing a web application that will have "plugins". The plugins will be .DLL files which will export their functionality through predefined interfaces 'n stuff. All the .DLL files are in a folder called "Plugins", and the ASP.NET application loads them all upon startup (by using Assembly.LoadFrom).

The problem is that when developing, these plugins will change fairly often (all the functionality is in the plugins, the website itself is just a skeleton). Thus, I need a way to automatically restart the application when the .DLL files change.

How do I do that?

Was it helpful?

Solution

IF the plugins directory is under your Bin directory, the web app will automatically be restarted when anything changes.

OTHER TIPS

The FileSystemWatcher class is a general solution to these kind of problems, and HttpRuntime.UnloadAppDomain(); is one way to restart your app. I think more research/explanation is required: there are many possible solutions.

Edit: Probling Paths. Nice answer.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top