I have some code to load a exe file and shows its CIL code to user. To do it I use Mono.Cecil and Mono.Cecil.Cil.
Now I wanna do something different: I wanna know if user has Mono.Cecil and Mono.Cecil.Cil in his system. to do that I thought to use Reflection.Assembly.Load with Mono.Cecil and Mono.Cecil.Cil. Something like:
public void PrintInstr( ) {
try
{
Reflect.Assembly mc = Reflect.Assembly.Load( "Mono.Cecil" );
Reflect.Assembly mcc = Reflect.Assembly.Load( "Mono.Cecil.Cil" );
}
catch( Exception )
{
System.Console.WriteLine( "\"Mono.Cecil\" or \"Mono.Cecil.Cil\" not found " );
return;
}
//[...]
}
But I only get the following error:
Could not load file or assembly 'Mono.Cecil' or one of its dependencies.
The system cannot find the file specified.
And, of course, I have Mono.Cecil and Mono.Cecil.Cil. Am I not using properly Assembly.Load? If it's the case, can someone tell me how to use Assembly.Load to be able to load Mono.Cecil and Mono.Cecil.Cil without looking for a path ( to make an only exe file to be used under Windows or GNU/Linux with mono )?
Note: I'm working under Linux Mint with MonoDevelop 2.6 or under windows 7 with MonoDevelop 2.8.