简体   繁体   English

c#错误1找不到类型或名称空间名称”(是否缺少using指令或程序集引用?)

[英]c# Error 1 The type or namespace name '' could not be found (are you missing a using directive or an assembly reference?)

I'm trying to make a DLL of a base class that is inherited by classes in another DLL and I'm getting the above error when I name the namespace and the class anything but the default name. 我试图制作一个基类的DLL,该基类由另一个DLL中的类继承,当我为命名空间和该类命名时使用默认名称之外的名称时,出现上述错误。

This is what I want it to look like: 这是我想要的样子:

namespace SportsBaseClasses
{
   class BaseClass
   {

It works when it looks like this: 它的工作原理如下:

namespace ClassLibrary1
{
   public class Class1
   {

I'm using the appropriate "using" and I have it added as a reference. 我正在使用适当的“使用”,并将其添加为参考。 I've looked up this question half a dozen times and no one else seems to have this problem. 我已经六次查询了这个问题,似乎没有人遇到这个问题。 Thank you in advance for your help. 预先感谢您的帮助。

Try making BaseClass public. 尝试将BaseClass公开。

namespace SportsBaseClasses
{
   public class BaseClass
   {

Or may be try 或者可以尝试

using ClassLibrary1.Class1

OR 要么

using BaseClass = ClassLibrary1.Class1

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 找不到类型或名称空间名称“ MySql”(您是否缺少using指令或程序集引用?)c#VS 2013 - The type or namespace name 'MySql' could not be found (are you missing a using directive or an assembly reference?) c# VS 2013 C#:找不到类型或名称空间名称“?Attribute”(是否缺少using指令或程序集引用? - C#:The type or namespace name '?Attribute' could not be found (are you missing a using directive or an assembly reference? 找不到类型或命名空间名称“ScriptName”(您是否缺少 using 指令或程序集引用?)修复 unity c# - The type or namespace name 'ScriptName' could not be found (are you missing a using directive or an assembly reference?) fix unity c# C#:找不到类型或名称空间名称“类”(是否缺少程序集引用的using指令?) - C#: The type or namespace name 'class' could not be found(are you missing a using directive for an assembly reference?) C# 错误:错误 CS0246 找不到类型或命名空间名称“”(您是否缺少 using 指令或程序集引用?) - C# Error: Error CS0246 The type or namespace name '' could not be found (are you missing a using directive or an assembly reference?) 为什么会出现这个错误? “找不到类型或名称空间名称'c'(您是否缺少using指令或程序集引用?)” - Why this error ? “The type or namespace name 'c' could not be found (are you missing a using directive or an assembly reference?)” 如何解决C#错误“找不到类型或名称空间名称'[x]'(您是否缺少using指令或程序集引用?)” - How to fix C# error “The type or namespace name '[x]' could not be found (are you missing a using directive or an assembly reference?)” C# 错误 CS024 找不到类型或命名空间名称“Form1”(您是否缺少 using 指令或程序集引用?) - C# Error CS024 The type or namespace name 'Form1' could not be found (are you missing a using directive or an assembly reference?) C# 错误 CS0246 找不到类型或命名空间名称“Socket”(您是否缺少 using 指令或程序集引用) - C# error CS0246 The type or namespace name 'Socket' could not be found (are you missing a using directive or an assembly reference) CS0246 C#找不到类型或名称空间名称“ ForeignKeyAttribute”(是否缺少using指令或程序集引用?) - CS0246 C# The type or namespace name 'ForeignKeyAttribute' could not be found (are you missing a using directive or an assembly reference?)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM