I am trying to read an executing exe file to set its properties using reflection.
It's giving error "The process cannot access the file 'D:\application\bin\Debug\XYZ.exe' because it is being used by another process.
How i set property of this exe file?
My code is here:
Assembly assembly = null;
//Loads file into Bytle array - prevent file locking
byte rawAssembly = loadFile(str);
assembly = Assembly.Load(rawAssembly);
Type controllerAppType = assembly.GetType("Namespace.App");
object instance = Activator.CreateInstance(controllerAppType);
controllerAppType.GetProperty("IsChanged").SetValue(instance ,true, null);
View Complete Post