错误 CS0246在 Visual c# 中找不到类型或命名空间名称“硬件”(您是否缺少 using 指令或程序集引用?) 当我们在 C# 控制台应用程序中的 Visual Studio 2k19 中运行此程序时出现问题显示:错误 CS0246找不到类型或命名空间名称“硬件”(您是否缺少 using 指令或程序集引用?)
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace OOP1
{
class Program
{
static void Main(string[] args)
{
Hardware hf = new Hardware(); // error in this line
Console.ReadLine();
}
}
}
--------------
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace OOP1.com.inventoryMsystem
{
class Hardware : Product
{
public Hardware()
{
Console.WriteLine("Hardware");
}
}
}
----------
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace OOP1.com.inventoryMsystem
{
class Product
{
public Product()
{
Console.WriteLine("Product");
}
}
}