The debugger can't resolve types of dynamic assemblies.
Here is a little example:
namespace DebugTest
{
using System;
using System.Reflection;
using System.Reflection.Emit;
class Program
{
public static void Main(string[] args)
{
var assemblyBuilder = AppDomain.CurrentDomain.DefineDynamicAssembly(new AssemblyName("MyAssembly"), AssemblyBuilderAccess.Run);
var moduleBuilder = assemblyBuilder.DefineDynamicModule("MyTypes");
var typeBuilder = moduleBuilder.DefineType("MyException", TypeAttributes.Public, typeof(Exception));
var myException = typeBuilder.CreateType();
var instance = Activator.CreateInstance(myException);
Console.ReadLine();
}
}
}
If you hold your mouse over "instance", it just shows the name of the type, but you can't expand and navigate through the properties and fields:
The watch window also doesn't work as expected, you can't even call GetType() on instance:
I debugged a bit and found Debugger.Value.CheckObject throws an Exception, because the objectInstance.Type is of TypeKind.Unknown and does not have a definition.
The debugger can't resolve types of dynamic assemblies. Here is a little example:
If you hold your mouse over "instance", it just shows the name of the type, but you can't expand and navigate through the properties and fields:
The watch window also doesn't work as expected, you can't even call GetType() on instance:
I debugged a bit and found Debugger.Value.CheckObject throws an Exception, because the objectInstance.Type is of TypeKind.Unknown and does not have a definition.
If you need more information, let me know.