I Have a Solution with 2 Proyects:
- __mvc4
- getClassesMethods
the getClassesMethods have a reference to __mvc4 , so I want to get All the Classes and Methods from a namespace inside the __mvc4 Project so I have this code to Load and get all the Assemblies from the AppDomain
Here's is the breakpoint at the var asssemblies (contains the __mvc4 Assembly)
namespace getClassesMethods
{
class Program
{
static void Main(string[] args)
{
var loadedAssemblies = AppDomain.CurrentDomain.GetAssemblies().ToList();
var loadedPaths = loadedAssemblies.Select(a => a.Location).ToArray();
var referencedPaths = System.IO.Directory.GetFiles(AppDomain.CurrentDomain.BaseDirectory, "*.dll");
var toLoad = referencedPaths.Where(r => !loadedPaths.Contains(r, StringComparer.InvariantCultureIgnoreCase)).ToList();
toLoad.ForEach(path => loadedAssemblies.Add(AppDomain.CurrentDomain.Load(AssemblyName.GetAssemblyName(path))));
var assemblies = AppDomain.CurrentDomain.GetAssemblies().ToList();
But I don't know how to get all the Classes and Methods from the ___mvc4 Assembly in the var assemblies. Hope you can help me!