在VS2010下调试COM +组件时出现问题。
当我进入一个组合方法并将成员变量添加到监视窗口时,它显示错误的值。同时正确显示局部变量的值。
是否可以修复成员变量的监视窗口?
class MyComponent : ServicedComponent, MyInterface
{
private int _val;
protected override void Activate()
{
_val = 1;
// _val is a member variable.
// According to watch window value of _val is 4052134 or something.
// This could not be truth!
int x = _val;
// x is a local variable.
// According to watch window value of x is 1.
// This is correct.
}
}
更多详情:
1)通过Activator创建的COM +组件
Type classSC = Type.GetTypeFromProgID(item.Name)
Object obj = Activator.CreateInstance(classSC)
2)当调试组件“this”指向__TransparentProxy
时3)针对不同的激活类型Library / Server重现了同样的问题。