简体   繁体   English

缺少using指令或程序集引用?

[英]missing a using directive or an assembly reference?

I am getting this error Error 4 The type or namespace name 'Sample' could not be found (are you missing a using directive or an assembly reference?) F:\\oadmin\\sea\\Controls\\Dlg.cs 11 7 Controls 我收到此错误错误4找不到类型或名称空间名称“示例”(您是否缺少using指令或程序集引用?)F:\\ oadmin \\ sea \\ Controls \\ Dlg.cs 11 7控件

here i added Samplein reference section,,,then i used it as Using Sample ,,i dont know why i am getting this error 在这里我添加了Samplein 参考部分,然后将其用作“ 使用示例” ,我不知道为什么我收到此错误

this is the class 这是班

namespace sample
{

    public class Server
    {



        public class client
        {

        Bool sent = true

        }

}

}

Can i share exe,,this Sample is an exe 我可以共享一个exe文件吗,这个示例是一个exe文件

Perhaps because your namespace is sample and not Sample? 也许是因为您的命名空间是示例而不是示例? So if your Dlg namespace is different it needs to have a using sample line not using Sample . 因此,如果您的Dlg名称空间不同,则需要using sample行而不using Sample

Or perhaps your class is in another project within your solution and you need to include the hierarchy of namespaces? 还是您的类在解决方案中的另一个项目中,并且您需要包括名称空间的层次结构?

Your namespace "sample" is lowercase, but you are referring to it in uppercase "Sample" ... 您的命名空间“样本”为小写,但您使用大写“样本”来引用它...

EDIT: You Bool sent is internal , it cannot be accessed from outside of the assembly 编辑:您Bool sentinternal ,不能从程序集外部访问

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM