无法加载.Net程序集

无法加载.Net程序集,.net,windows,vb.net,dll,.net-assembly,.net,Windows,Vb.net,Dll,.net Assembly,我试图访问服务器上运行的VB程序中的.Net程序集。我收到经常提到的无法加载文件或程序集错误。我已经浏览了大约60个不同的网页,但我所做的一切都没有修复它 我的dll与正在启动的可执行文件位于同一目录中。在Appbase中显示的是file://?/c:,在我研究这个的其他示例中,它们都有file://。我不知道这是否是问题所在。如果是的话,有人能告诉我怎么修理吗?我曾尝试搜索文件://?//,但这忽略了所有特殊字符,即使是在谷歌和必应中用问号括起来的字符,这是我能告诉你的 错误消息: Unhan

我试图访问服务器上运行的VB程序中的.Net程序集。我收到经常提到的
无法加载文件或程序集
错误。我已经浏览了大约60个不同的网页,但我所做的一切都没有修复它

我的dll与正在启动的可执行文件位于同一目录中。在Appbase中显示的是
file://?/c:
,在我研究这个的其他示例中,它们都有
file://
。我不知道这是否是问题所在。如果是的话,有人能告诉我怎么修理吗?我曾尝试搜索
文件://?//
,但这忽略了所有特殊字符,即使是在谷歌和必应中用问号括起来的字符,这是我能告诉你的

错误消息:

Unhandled Exception: System.TypeInitializationException: The type initializer for 'cgiTest.modCurrentBalance' threw an exception. ---> 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

执行程序的用户是否具有访问文件和文件夹的权限?可能是该文件是从具有不同ACL的文件夹中移动而不是复制的,代码无法访问该文件


最好的检查方法是获取、配置其筛选器以仅显示对包含“Aspose.Cells”的路径的访问,并查看哪些进程尝试访问该文件,如果失败,以及如果失败-原因。

DLL不应该位于应用程序的BIN文件夹中吗?当您的应用程序编译时,它将在那里查找程序集。

我终于能够使用中描述的事件处理程序加载此程序集

在这一点上,我不确定为什么我必须走这条路线,但它是由我指定的路径,二进制和dll都位于,这应该是默认的行为


我唯一能想到的是,它与文件路径“file://?/”中的问号有关,它在该路径中查找dll,但是我不知道为什么会有问号。

那么,
Aspose.Cells.dll在哪里呢?
?它在c:\inetpub\intranet的c:\inetpub\intranet目录下02/25/2013 10:02 PM 7172952 Aspose.Cells.dll 1文件中7172952字节您可以发布尝试加载程序集的代码吗?DLL位于应用程序所在的BIN文件夹中。很抱歉,您说“我的DLL与正在启动的可执行文件位于同一目录中”,我误解了。您是否尝试过server.mappath(“c:/inetpub/intranet/”)