I am loading an assembly as follows:
var bytes = File.ReadAllBytes("E:/Code/Projects/MyUtilities/bin/Debug/MyUtilities.dll");
Assembly loadedAssembly = Assembly.Load(bytes);
The assembly is loaded fine and I can call functions with invoke:
System.Type type = loadedAssembly.GetType("DLLTest.MyUtilities");
FieldInfo field = type.GetField("c");
Debug.Log(field.GetValue(null));
// get the method
MethodInfo method = type.GetMethod("test", BindingFlags.Public | BindingFlags.Static);
object[] args = new object[1];
args[0] = 2;
var result = method.Invoke(null, args).ToString(); // assuming it doesn't take parameters
When I add the DLL project into the UNity solution and set a break point in the DLL project its not hit. The PDB is right beside the DLL. I have tried to keep it beside Library\ScriptAssemblies\Assembly-CSharp.dll as well. Still the breakpoint is not hit in the DLL code.
Tried all solution mentioned here: http://stackoverflow.com/questions/1295807/debug-dynamically-loaded-assembly-in-visual-studio-net?noredirect=1&lq=1
Does it have to be a mdb file rather than a PDB file?
↧