I am playing with RazorGenerator.Mvc at the moment, the purpose is to create a modular framework for my MVC4 applications. I have been following several tutorial found via Google, and my application does work fine.

But, I have a question that keep bugging me. So, my solutions looks like this:

-CoreMVCProject

-MVCModuleA

-MVCModuleB

I managed the Modules Project to copy the generated assemblies into the bin folder of the CoreMVCProject, this works with no issue so far.

But, when I create a Plugins folder in the CoreMVCProject, the views from the modules cannot be read, it always give error that said the views cannot be found.

Though, I have also added codes to add the assemblies within the Plugins folder, like:

var fullPluginPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Plugins");

        foreach (var file in Directory.EnumerateFiles(fullPluginPath, "*.dll"))
            PluginAssemblies.Add(Assembly.LoadFile(file));

        PluginAssemblies.ForEach(BuildManager.AddReferencedAssembly);

The views from Modules still cannot be read, though the Controllers and other logics in the modules can be accessed and performed without any problem.

So, in summary, the problem is how to manage it so the views can be read normally even if the assemblies are not copied into the bin of the main MVC Project.

Any Suggestion ?

0

There are 0 best solutions below