I'm trying to add new dlls to my application. I've tried using Ninject:
var standardKernel = new StandardKernel();
ServiceLocator.SetLocatorProvider(() => new NinjectServiceLocator(standardKernel));
standardKernel.Load<MyPluginBootstrapper>();
standardKernel.Bind<IHelloWorldService>().To<HelloWorldService>();
DependencyResolver.SetResolver(new MyDependencyResolver(standardKernel));
I've tried using:
var _fullPluginPath = Path.Combine(path, "App2.Plugin.dll");
AppDomain.CurrentDomain.Load(Assembly.LoadFrom(_fullPluginPath).GetName());
And I always got the same error when I try to access to a controller that is in that new dll:
Compilation Error
Compiler Error Message: CS0246: The type or namespace name 'App2' could not be found (are you missing a using directive or an assembly reference?)
Line 26: using System.Web.Optimization;
Line 27: using System.Web.Routing;
Line 28: using App2.Plugin;
Line 29:
Line 30:
Source File: c:\Users\wilhem\AppData\Local\Temp\Temporary ASP.NET Files\root\0c41d57d\e08d7bc3\App_Web_index.cshtml.244a139d.hzhandta.0.cs Line: 28
I'm implementing like a plugins based architecture and I want the ability to add new dlls without restart the application. Any idea with the code above?