1) есть одна длл CurrentClient_V1, которая включает в себя как reference другую длл - UserDll.dll (код в проект не подключен).
Код:
namespace CurrentClient
{
public class A_StoreTest
{
static public void test_Client_test1()
{
Console.WriteLine("A_StoreTest::test_Client_test1()");
UserDll.UserCls.testFunc_1();
}
static public void test_Client_test2()
{
Console.WriteLine("A_StoreTest::test_Client_test2() ");
UserDll.UserCls objTest = new UserCls();
objTest.testFunc();
}
}
}
2) есть третья длл, которая загружает нашу CurrentClient_V1 динамически.
Затем я нахожу в загруженной длл-ли свой класс, в нем - нужную функцию и пытаюсь ее вызвать.
Assembly curDll = Assembly.LoadFile(assemblyName);
foreach (Type type in curDll.GetTypes())
{
if (type.Name == m_sTestClass)
{
testType = type;
break;
}
} // foreach (Type type in curDll.GetTypes())
System.Reflection.MethodInfo[] methods = testType.GetMethods();
for (int i = 0; i < methods.Length; i++)
{
System.Reflection.MethodInfo curMethod = methods[i];
object[] myparam = null;
curMethod.Invoke(null, myparam);
}
Ошибка:
System.IO.FileNotFoundException : Could not load file or assembly 'UserDll, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.
Посмотрела в окошке "modules" в студии - действительно нет...
А вот почему?
