title: Unable to load a .Net assembly
body: <p>I am attempting to access a .Net assembly in a VB program running on a server. I am receiving the often mentioned <code>Could not load file or assembly</code> error. I have been through about 60 different web pages and nothing I have done has fixed it. </p>
  
  <p>I have the dll in the same directory as the executable I am launching. In the Appbase it is showing <code>file://?/c:</code> and in the other examples that I have seen researching this, they all had <code>file:///</code>. I don't know if that could be the issue or not. If it is, can anyone tell me how to fix it? I have tried searching for <code>file://?/</code> but that ignores all of the special characters even when enclosed in question marks in Google and Bing, as best I can tell.</p>
  
  <p>Error Message:</p>
  
  <pre><code>Unhandled Exception: System.TypeInitializationException: The type initializer for 'cgiTest.modCurrentBalance' threw an exception. ---&gt; System.IO.FileNotFoundException: Could not load file or assembly 'Aspose.Cells, Version=7.4.1.0, Culture=neutral, PublicKeyToken=716fcc553a201e56' or one of its dependencies. The system cannot find the file specified.
  File name: 'Aspose.Cells, Version=7.4.1.0, Culture=neutral, PublicKeyToken=716fcc553a201e56'
     at cgiTest.modCurrentBalance..cctor()
  
  === Pre-bind state information ===
  LOG: User = WEBSERVER1\Administrator
  LOG: DisplayName = Aspose.Cells, Version=7.4.1.0, Culture=neutral, PublicKeyToken=716fcc553a201e56
   (Fully-specified)
  LOG: Appbase = file://?/c:/inetpub/intranet/
  LOG: Initial PrivatePath = NULL
  Calling assembly : cgiTest, Version=1.0.0.0, Culture=neutral, PublicKeyToken=abaf442583423e6f.
  ===
  LOG: This bind starts in default load context.
  LOG: No application configuration file found.
  LOG: Using machine configuration file from c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\config\machine.config.
  LOG: Post-policy reference: Aspose.Cells, Version=7.4.1.0, Culture=neutral, PublicKeyToken=716fcc553a201e56
  LOG: Attempting download of new URL file://?/c:/inetpub/intranet/Aspose.Cells.DLL.
  LOG: Attempting download of new URL file://?/c:/inetpub/intranet/Aspose.Cells/Aspose.Cells.DLL.
  LOG: Attempting download of new URL file://?/c:/inetpub/intranet/Aspose.Cells.EXE.
  LOG: Attempting download of new URL file://?/c:/inetpub/intranet/Aspose.Cells/Aspose.Cells.EXE.
  
     --- End of inner exception stack trace ---
     at cgiTest.modCurrentBalance.GenerateReport()
     at cgiTest.Module1.ProcessFunction() in q:\visual studio 2010\Projects\cgiTest\cgiTest\Module1.vb:line 65
     at cgiTest.Module1.Main() in q:\visual studio 2010\Projects\cgiTest\cgiTest\Module1.vb:line 41
  </code></pre>