Note that there are some explanatory texts on larger screens.

plurals
  1. POASP.NET application reference to assembly in programmatically loaded assembly
    primarykey
    data
    text
    <p>My ASP.NET application loads an assembly and creates a class instance from an object within it. The assembly itself has a reference to a dll called "Aspose.Cells.dll" which it can access without any problems and is located on the same path as the assembly file itself. However, when I make a method call to one of its methods I get this error:</p> <blockquote> <p>Could not load file or assembly 'Aspose.Cells, Version=4.1.2.0, Culture=neutral, PublicKeyToken=9a40d5a4b59e5256' or one of its dependencies.</p> </blockquote> <p>I figure that I need to make my ASP.NET application reference this DLL as well but everything I've tried so far has failed. The assembly DLL which is loaded is not located within the root of the web application and I'm hoping that it doesn't have to be.</p> <p>I can load the assembly like this:</p> <pre><code>Assembly asm = Assembly.LoadFile(@"D:\Dev\EasyFlow\Plugins\ImportExportLibrary\bin\Debug\Aspose.Cells.dll"); </code></pre> <p>But I can not use it like this:</p> <pre><code>AppDomain newDomain = AppDomain.CreateDomain("testAspose"); Assembly asm = newDomain.Load(System.IO.File.ReadAllBytes(@"D:\Dev\EasyFlow\Plugins\ImportExportLibrary\bin\Debug\Aspose.Cells.dll")); </code></pre> <p>Is there a better way to do it?</p> <h3>Update:</h3> <p>Thanks for your replies.</p> <p>I forgot to mention that I cannot copy the assemblies to the bin folder or the GAC because I want it to work as a plugin system where assemblies can be replaced easily by changing the path to assemblies in a configuration file and not having to manually copy files into the main project.</p> <p>However, the <code>AssemblyResolve</code> event seems interesting and I will give it a try later.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload