我已经将Microsoft.PointOfService.dll添加到我的项目的引用中,VS甚至正确地解析了它的成员类,但是,当我尝试构建时,我得到了标题错误:
名称空间“Microsoft”中不存在类型或命名空间名称“PointOfService”(您是否缺少程序集引用?)
我的代码如下:
using Microsoft;
using Microsoft.PointOfService;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace oposfordotnet
{
public partial class Form1 : Form
{
PosExplorer explorer = new Microsoft.PointOfService.PosExplorer();
CashDrawer drawer;
}
}
我以前从未见过这个。似乎dll没有正确编写以适应Microsoft命名空间?这甚至可能吗?
无论如何,我已经尝试删除引用并重新创建它并重新启动Visual Studio,但这些操作都没有起作用。
有人可以建议修复吗?
答案 0 :(得分:0)
根据@StephenRoss对问题的评论,我更改了项目使用的.NET Framework版本,这解决了这个问题。