プロジェクトにいくつかの CS クラス ファイルを追加しました ( Existing Items )。そのうちの 1 つは、次のコードが含まれていました。
[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' 属性が重複しています
A wrapper for the canon CDSDK and PRSDK for remote captureからサンプルと CS ファイルをダウンロードしました。
サンプルをダウンロードした後、cannonSDK のサンプルを使用しました。そして、Assemlyinfo.cs
ファイルを含め、そこからすべての CS ファイルを追加しました。