sarah joseph

sarah joseph

  • NA
  • 170
  • 393

hello, i want to make deserialization of class from dll in runtime reg

Jun 8 2023 10:52 PM

hello, i want to make deserialization of class from dll in runtime regarding to ability to change the dll path.
i clearify more
firstly, why i don't use xml or json?
1 because dll is more fast  than others specially when the class has more and more fields.
2 i don't want to make the file to be readable to the user
now, i write what i made and i ask for help
1 i make serialized class such as
namespace WindowsFormsApp15
}
    [Serializable]
public class Me
{
public string sarah = "sarah";
public int number = 55;
//more and more. etc
}
}
2 i save this class as dll file. with name "sarah.dll"
3 i create other class with the same fields but with other values such as
 namespace WindowsFormsApp15
}
    [Serializable]
public class Me
{
public string sarah = "joseph";
public int number = 110;
//more and more. etc
}
}
4 i save this class as dll file. with name "joseph.dll";
5 i  imported the first  dll (sarah.dll)to my project as reference 
6 i use "use  WindowsFormsApp15"
7 i make object from this class such as
public   WindowsFormsApp15.me sarsoura=  new  WindowsFormsApp15.me = ();
8 i want to show message with string "sarah"
MessageBox.Show(sarsoura.sarah);
now everything is ok
but i want to deserialized class from the second dll (joseph.dll) as runtime.
my idea that, i make ability to users to create more and more dlls from significant class in runtime  as they want.
and call the dlls again from its path to fetch data from them
how i can achieve that?
i use more ways but unfortunally without any success
please if anyone want to help me, please give me example or project as attachment  with solution.


 


Answers (5)