I have some ASP.NET application which composed of some modules. The web application has not direct reference to these modules. But in some part of its code it Loads those assemblies using following code in MyWebApplication.dll:
// modules: Module1 (Module1.dll), Module2 (Module2.dll), ...
foreach(module in modules)
{
Assembly.Load(module)
}
But when I'm running the application, it can't load the module.
To debug it, I checked where the other assemblies are located using:
typeof(SomeType).Assembly.Location
and the result was:
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\99db3519\a290da98\assembly\dl3\b95f323e\b38a9c7e_53bdd001
In the following folder
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\99db3519\a290da98\assembly\dl3
there are the other assemblies each one in a separate folder. But it seems that ASP.NET brings just the required dll
files here. And it seems that it brings the assemblies that are referenced in some way from the WebApplication
.
Unfortunately my module assemblies are not referenced from WebApplication
as they're being loaded dynamically at run time.
Question: How can I say to ASP.NET to copy and bring my modules too, so I can load them at run time?