C# 中的错误:找不到类型或命名空间名称 > `FTDI_Mgt'/缺少程序集引用

问题描述

我不知道我下面的代码有什么问题。使用 Mono,mcs 在 Linux/raspBerry 上编译。

当我尝试使用 (mcs) 进行编译时,我收到以下消息:

FTDI_Mgt.cs(15,38):错误 CS0246:类型或命名空间名称 找不到“FTDI_Mgt”。您是否缺少程序集参考?

这是我在一个名为 FTDI_Mgt.cs文件中的代码的一部分:

using System;
using System.Collections.Generic;
using System.Windows.Forms;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Diagnostics;
using System.Collections.Concurrent;
using System.IO;
using FTD2XX_NET;
using myGenericTool;

namespace ST_NBIOT_TOOL
{
    public partial class FTDI_Mgt1: FTDI_Mgt             ///// line 15
    {

//..
        public FTDI_Mgt()       ////// line 51
        {
            Init_timerGetData();

        }
        private void Init_timerGetData()
        {
            timerGetData = new Timer();
            timerGetData.Interval = 5;
            timerGetData.Tick += new EventHandler(ReadData_Tick);
       }

我的Program.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace ST_NBIOT_TOOL
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new FTDI_Mgt1());
        }
    }
}

我尝试将 FTDI_Mgt.cs 中的 Application.Run(new FTDI_Mgt1()) 更改为 Application.Run(new FTDI_Mgt()) 并将 ligne 15 更改为 public class FTDI_Mgt 我收到此错误

FTDI_Mgt.cs(51,16):错误 CS1520:类、结构或接口方法 必须有返回类型

有什么想法吗?有什么帮助吗?我错过了什么?我不是 C# 专家!

提前致谢

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)