临时学习C#接替离职同事工作,对C#深层次点的东西就不无法解决,现在需要
使用托管方式定义C#结构体,结构体数组嵌套结构体数组如下:
[System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequentiali)]
public struct test_info_t
{
unsigned short u16Ida;
unsigned short u16Idb;
};
[System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequentiali)]
public struct struct_cfg_t
{
[System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.ByValArray, SizeConst =
16, ArraySubType = System.Runtime.InteropServices.UnmanagedType.Struct)]
public test_info_t[] stuTestInfo[16];
};
[System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequentiali)]
public struct test_t
{
[System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.ByValArray, SizeConst
= 4, ArraySubType = System.Runtime.InteropServices.UnmanagedType.Struct)]
public intersection_cfg_t[] stucfg];
};
运行时出现错误:
“System.TypeLoadException”类型的未经处理的异常在 mscorlib.dll 中发生
其他信息: 未能从程序集“iCardSetupTool, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null”中加载类型“iCardSetupTool.FormMain”。
请问各位大神怎么解决?