Code
[Stathread]
Static Void Main ()
{
Try
{
Appdomain. currentdomain. assemblyresolve + = New Resolveeventhandler (currentdomain_assemblyresolve );
// Appdomain. currentdomain. Load (properties. Resources. xxx_admin );
// Load a master from a binary streamProgramSet (exe file)
Assembly = Assembly. Load (properties. Resources. xxx_admin );
// Method for getting the Assembly entry (main method)
Methodinfo Mi = Assembly. entrypoint;
// Call the Assembly Entry Method
Mi. Invoke ( Null , Null );
}
Catch (Exception ex)
{
String MSG = Ex. message;
Throw ;
}
}
/// <Summary>
/// Load the Assembly referenced by the main assembly
/// </Summary>
Static Assembly currentdomain_assemblyresolve ( Object Sender, resolveeventargs ARGs)
{
Assembly = Null ;
Try
{
String Dllname = Args. Name. Split ( ' , ' )[ 0 ];
If (Dllname. startswith ( " Xxx. Common " ))
{
Assembly = Assembly. Load (properties. Resources. xxx_common );
}
}
Catch (Exception)
{
MessageBox. Show ( " Load a dataset " + Args. Name + " Error! " );
}
Return Assembly;
}