我在自己生成的代码中引用了一个我无法真正控制的代码。访问器和MissingMethodException
这个文件吨的类定义,像下面这样:
namespace _Outputs.CEEM
{
public sealed class DoorDrvrSts : SystemVariableBase, ITypedRuntimeValue<int>, IRuntimeValue
{
public const int Clsd_DoorDrvrSts = 2;
public const int Opend_DoorDrvrSts = 1;
public const int Ukwn_DoorDrvrSts = 0;
public static DoorDrvrSts Instance { get; }
public int TypedValue { get; set; }
public static int Value { get; set; }
protected override void DoInvalidateInstance();
public delegate void ValueChanged();
}
}
这是我尝试使用上面的类:
_Outputs.CEEM.DoorDrvrSts.Value = _Outputs.CEEM.DoorDrvrSts.Ukwn_DoorDrvrSts;
但后来我得到下面的异常:
A .NET exception (MissingMethodException) occured in the module PowerManagement
Error message: Method not found: 'Void _Outputs.CEEM.DoorDrvrSts.set_Value(Int32)'.
Throwing method: PowerManagement.DoTest
当我们收到一个由DLL生成的新库时,整个问题就开始了。 我真的不知道在哪里看!我已经重新生成了DLL,并确保这些实际上是我的解决方案中的参考。
有没有人有任何其他的想法? 当我们在其他机器上运行完全相同的代码时(我可以看到完全相同的hw,sw,.NET和windows),我们没有任何问题。这意味着什么?
这是自动生成的代码作为我不能改变的DLL。我只能改变我的使用方式。 – theAlse
@theAlse:检查更新后的答案。 –
@theAlse:需要更多帮助?希望这个答案是足够的。 –