继承类和引用dll之间的区别是什么? [英] what is the deference between inheriting a class and reference a dll.

查看:114
本文介绍了继承类和引用dll之间的区别是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

共有3种不同的命名空间

我被添加到第二个名称空间的第一个名称空间引用.

如果我被添加,则将第二个命名空间引用到该第三个命名空间,

第三个名称空间中的内容仅包含第二个名称空间中的内容.

为什么我们没有在第3个命名空间中得到firstspace空间的东西.
我也在对象浏览器中尝试过.
我在这里忘记了什么吗?

there are 3 different namespace

i was added 1st namespace references to the second namespace .

if i was add reference the 2nd namespace to this 3rd namespace ,

in third namespace only contains the 2nd namespace things only.

why we were not getting firstnamespace things in 3rd namespace.
i was tried in object browser also.
did i was forget any thing here .

推荐答案

c#名称空间与UML名称空间不同.

您不要将名称空间的内容导入到.Net中的另一个名称空间中.

using只是避免在源代码中使用完全限定名称的一种方法.

最好的问候
Espen Harlinn
c# namespaces are not the same as UML namespaces.

You do not import the contents of a namespace into another namespace in .Net.

using is just a way to avoid using fully qualified names in in the source code.

Best regards
Espen Harlinn


请参阅我对问题的评论.这个问题根本没有道理.

不,您没有向名称空间添加名称空间引用.首先,没有命名空间引用"之类的东西.其次,您不能向命名空间添加任何东西,而不仅仅是引用.通常,名称空间根本不包含任何语义,它只是定义命名时如何在标识符之前加上前缀,其他什么都没有.

添加引用作为为CLR编写的代码的功能单元之间的关系的概念(不要将其与引用"的概念作为托管指针的概念相混淆)是程序集之间的关系,从不存在任何关系别的.基本上,一个程序集可以通过其名称引用另一个程序集.如果程序集没有强名,也没有放在GAC中,则涉及文件名.但是,严格来说,文件名不是程序集的名称,而是其可执行模块的名称.在使用Visual Studio进行开发时,模块几乎是不可见的,因为它只允许一种组装,而组装仅由一个主模块组成,但是使用MSBuild的独立编译器,可以创建多模块组装.它们不是很需要,因此VS不支持它们,但是(至少)始终存在一个模块.

您应该从学习汇编的概念开始,汇编是.NET,CLI和CLR的基本概念:
http://en.wikipedia.org/wiki/.NET_assembly [ http://msdn.microsoft.com/en-us/library/k3677y81.aspx [ ^ ],
http://www .codeguru.com/csharp/.net/net_general/article.php/c4643/Giving-a-NET-Assembly-a-Strong-Name.htm [ http://en.wikipedia.org/wiki/Common_Language_Infrastructure [ http://en.wikipedia.org/wiki/Common_Language_Runtime [
Please see my comment to the question. The question makes no sense at all.

No, you did not add a namespace reference to a namespace. First of all, there is no such thing as "namespace reference". Second, you cannot add anything, not just reference, to a namespace. In general, a namespace does not carry any semantic at all, it simply defines how any identifier should be prefixed while naming it, nothing else.

The notion of adding references as the relationship between functional units of code written for CLR (don''t mix it up with the notion of "references" as managed pointers) is the relationships between assemblies and never anything else. Basically, one assembly can reference another assembly by its name. If assembly does not have a strong name and not places in GAC, this involves file name. But, strictly speaking, a file name is not a name of assembly, but a name of its executable modules. In development with Visual Studio, module is almost invisible, because it allows only one kind of assembly — and assembly composed of only one, main module, but using stand-along compilers of MSBuild, it is possible to create multi-module assemblies. They are not very needed, so VS does not support them, but (at least) one module always exists.

You should start from learning the concept of assembly, a fundamental concept of .NET, CLI and CLR:
http://en.wikipedia.org/wiki/.NET_assembly[^],
http://msdn.microsoft.com/en-us/library/k3677y81.aspx[^],
http://www.codeguru.com/csharp/.net/net_general/article.php/c4643/Giving-a-NET-Assembly-a-Strong-Name.htm[^].

See also:
http://en.wikipedia.org/wiki/Common_Language_Infrastructure[^],
http://en.wikipedia.org/wiki/Common_Language_Runtime[^].

Please don''t think you can do programming without good understanding of the basics. You can write something, but who would need the result of it? If you don''t understand such basic things well, any development would be just a waste of time.

—SA


这篇关于继承类和引用dll之间的区别是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆