I'm trying to create a Pluggable system using asp.net
I've read this question and the big problem I've encountered is that i need to pass all sort of stuff from the plugin to the host such as: models, event handlers views (using RazorGenerator or alike) etc.
and when accessing them using appDomain proxies it requires that the passed objects will be serializable and not all items can be,
so my question is
what are the problems of Assembly.Load
, so if I'm doing the following
foreach(FileInfo file in files)
{
var assembly = Assembly.Load(file);
var type = assembly.GetTypes()
.FirstOrDefault(s => s.IsAssignableFrom(typeof(MyBaseType));
if(type == null)
{
continue;
}
var plugin = Activator.CreateInstance(type);
plugin.DoInitiaton();
// ... storing plugin for later use
}
and in example scenario someone hacked into my server and uploaded malicious DLL can it harm my application if I'm only loading it?