我用AppDomain实现动态加载dll,AppDomainLoader类创建程序域AppDmain,RemoteLoader加载dll,问题是我在AppDomainLoader调用RemoteLoader方法:public Assembly LoadAssembly(string dllurl)
        {
            _assembly = Assembly.LoadFile(dllurl);
            return _assembly;
        }该方法执行完没有问题,执行到AppDomainLoader的  return  _remoteLoader.LoadAssembly(dllUrl);时抛出下面异常:未能加载文件或程序集“Test, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null”或它的某一个依赖项。系统找不到指定的文件。我直接将创建AppDomain和Assembly放到windows服务里面写成一堆的话就没有错误,这是怎么回事?还有在windows服务的OnStart里面利用反射加载多个dll文件,怎样写?我尝试以:                TcpChannel tc = new TcpChannel(8999);
                ChannelServices.RegisterChannel(tc, false);
                Assembly asm = Assembly.LoadFile(@"F:\Work\Test\RemotingTest\ConsoleApplication1\bin\Debug\dll\Test.dll", "Test.Test");
                Type type = asm.GetType("Test.Test");
                RemotingConfiguration.RegisterWellKnownServiceType(type, "test", WellKnownObjectMode.SingleCall);
                TcpChannel tc = new TcpChannel(8899);
                ChannelServices.RegisterChannel(tc, false);
                Assembly asm = Assembly.LoadFile(@"F:\Work\Test\RemotingTest\ConsoleApplication1\bin\Debug\dll\Test1.dll", "Test.Test");
                Type type = asm.GetType("Test.Test");
                RemotingConfiguration.RegisterWellKnownServiceType(type, "test1", WellKnownObjectMode.SingleCall);
这样的形式直接放在windows服务的启动里面,结果出错了。