如何使用解决zkemkeeper嵌入的问题?

Rag*_*lka 7 interop comexception visual-studio-2013

请检查以下代码:

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Linq;
using System.ServiceProcess;
using System.Text;
using iTimeService.dsitimeTableAdapters;
using System.IO;

namespace iTimeService
{
    public partial class Service1 : ServiceBase
    {
        public Service1()
        {
            InitializeComponent();
        }
        public zkemkeeper.CZKEMClass axCZKEM1 = new zkemkeeper.CZKEMClass();
        private bool bIsConnected = false;//the boolean value identifies whether the device is connected
        private int iMachineNumber = 1;//the serial number of the device.After connecting the device ,this value will be changed.
        TENTERTableAdapter tenteradapter = new TENTERTableAdapter();
        T012_GATETableAdapter gateadapter = new T012_GATETableAdapter();
    }
}
Run Code Online (Sandbox Code Playgroud)

我在创建对象时遇到错误zkemkeeper.CZKEMClass:interop type 'zkemkeeper.CZKEMClass' cannot be embedded. Use the application interface instead.

小智 15

点击你的参考资料,我认为那个特定的项目将是'zkemkeeper'

然后在其属性上将"嵌入互操作类型"设置为"假"我希望这会有所帮助.