ASP.NET程序集探测问题

ASP.NET程序集探测问题,asp.net,assemblies,Asp.net,Assemblies,下面是我的目录结构 e:\test\probling 目录探测包含加载dll文件(Probe.dll)的可执行文件[probing.exe] 代码是: namespace Probing { class Program { static void Main(string[] args) { Assembly asm = Assembly.Load("Probe.dll");

下面是我的目录结构

e:\test\probling

目录探测包含加载dll文件(Probe.dll)的可执行文件[probing.exe]

代码是:

namespace Probing

  {
     class Program

     {
        static void Main(string[] args)

        {

                Assembly asm = Assembly.Load("Probe.dll");

                if (asm != null)

                {

                    Console.WriteLine("Assembly Probe is loaded");

                }

                else

                {
                    Console.WriteLine("Assembly Probe is not loaded");
                }

        }
    }
}
dll文件(Probe.dl)位于子目录(e:\test\probling\CustomLibraries\Probe.dll)中

我提供了probling.exe.config文件,甚至是App.config来定位程序集

配置文件包含以下代码:

<configuration>

<runtime>

<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">

<probing privatePath="CustomLibraries"/>

</assemblyBinding>

</runtime>

</configuration>

我收到FileNotFound异常,直到我将dll保存在Bin目录中


我需要您的帮助。(我正在使用Visual studio 2008)

尝试调试此程序的第一件事是-这样您将看到已选中的目录

探测只适用于应用程序目录下的子目录,因此,如您所说,如果您的应用程序位于…\bin中,而库位于…\lib中,则无法工作-它们需要位于…\bin\lib中

您需要使用