我在我的项目中添加了一些 CS 类文件(现有项目)。其中之一是里面有这段代码:
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode, Pack = 2)]
public unsafe struct prDeviceInfoTable{
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 512)]
public string DeviceInternalName; /* Internal device name (512 characters) */
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 32)]
public string ModelName; /* Camera model name (32 characters) */
public UInt16 Generation; /* Camera generation number */
public UInt32 Reserved1; /* Reserved */
public UInt32 ModelID; /* Camera model ID */
public UInt16 Reserved2; /* Reserved */
public UInt16 PortType; /* Port type 0x01FWIA / 0x02FSTI */
public UInt32 Reserved3; /* Reserved */
};
因此,在我的项目属性中,我将其更改为Unsafe。现在我Assemblyinfo.cs
在这些行的文件中收到 10 个错误:
[assembly: AssemblyTitle("CameraSDK Interface")]
[assembly: AssemblyDescription("Used to interface with the Canon SDK")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("LogicRAD")]
[assembly: AssemblyProduct("CameraSDK")]
[assembly: AssemblyCopyright("Copyright © 2006")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
例如,第一个错误是:
错误 1 重复的“AssemblyTitle”属性
我已经从Canon CDSDK 和 PRSDK for remote capture 的 A wrapper下载了示例和 CS 文件。
下载示例后,我使用了 cannonSDK 示例。并从那里添加所有 CS 文件,包括Assemlyinfo.cs
文件。