jeudi 14 juin 2018

Running an ASP.NET using dynamically loaded assemblies

How could I run an IIS express website using purely dynamically generated assemblies and webconfigs.

For example, I could dynamically run a Console Application by doing:

Assembly pAssembly = Assembly.LoadFrom([[ApplicationPath]]).

MethodInfo pMainMethod = pAssembly.GetType("Program").GetMethod("Main);

pMainMethod.Invoke(null, new Object[1] { new String[0]; });

I can even dynamically load the app config using something like in this question: Change default app.config at runtime

How could I do something similar for dynamically running an IIS express website using dynamically generated assemblies (these assemblies might not necessarily be on the file system, since they may have been fetched remotely).





Aucun commentaire:

Enregistrer un commentaire