首页 > 解决方案 > 如何在控制台应用程序中使用 Windows Burn-API

问题描述

我尝试使用控制台应用程序来处理来自 Windows Burning-API 的服务器功能。

当我尝试从 MsftDiscMaster2 获取 CD-ROM unique_Recorder_Id

/// Microsoft IMAPIv2 Disc Master ///
[ComImport]
[Guid("27354130-7F64-5B0F-8F00-5D77AFBE261E")]
[CoClass(typeof(MsftDiscMaster2Class))]
public interface MsftDiscMaster2 : IDiscMaster2 {}

我收到异常:

Could not load file or assembly 'CustomMarshalers, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified.

该代码在 WinForm 应用程序上运行良好

MsftDiscMaster2 discMaster = new MsftDiscMaster2();
MsftDiscRecorder2 discRecorder = new MsftDiscRecorder2();

    if (!discMaster.IsSupportedEnvironment)
        return;

    foreach (string uniqueRecorderId in discMaster) // This line throws the exp
    {
        discRecorder.InitializeDiscRecorder(uniqueRecorderId);
        Console.WriteLine(discRecorder.VolumeName);
    }

标签: c#console-applicationdiskdvd-burning

解决方案


推荐阅读