程序集与命名空间 [英] Assemblies vs. Namespace

查看:74
本文介绍了程序集与命名空间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想我可能会跟上一直误入歧途。


我引用的很多程序集都被命名为System,

System.Drawing等。有dll,即system.dll和

system.drawing.dll"等等。但是,在我的Imports语句中,我也使用

导入系统和导入System.Drawing,我假设是''名称空间''。


所以,微软是否只是想让我们迷惑命名它们相同,

或者是否存在直接关系?


例如,如果我有......


开始命名空间MyNamespace.SubSpace


结束命名空间


我可以把它放在一个名为''core.dll'的程序集中。所以我会引用Core,

但是导入MyNamespace.SubSpace?

虽然没什么大不了的,但我想我想保留dll的名字一点点

与实际名称空间有点不同,例如spcore,spui,

" spetc" ...

I think I might be on track to a misnomer that I keep running into.

A lot of the assemblies that I reference are named "System",
"System.Drawing", etc. There are dlls, ie, system.dll and
system.drawing.dll", etc. However, in my Imports statements, I also use
Import System and Import System.Drawing, which I assume are ''namespaces''.

So, is it that Microsoft just wanted to confuse us by naming them the same,
or is there some direct relation?

For example, if I have...

Begin Namespace MyNamespace.SubSpace

End Namespace

Can I put that in an assembly called ''core.dll''. So I would reference Core,
but Import MyNamespace.SubSpace?
Although not a big deal, I think I would like to keep the dll names a little
bit different than the actually namespaces, such as "spcore", "spui",
"spetc"...

推荐答案

" Richard Brown" < RB **** @ easylift.org> schrieb
"Richard Brown" <rb****@easylift.org> schrieb
我想我可能会对我一直运行的用词不正确。

我引用的很多程序集都命名为System ;,
System.Drawing等。有dll,即system.dll和
system.drawing.dll等等。但是,在我的Imports语句中,我也是
使用导入系统和导入System.Drawing,我假设它是''名称空间''。

那么,微软是否只是想通过命名它们来混淆我们
相同,还是有一些直接关系?


不,他们想让它变得更容易。如果你正在寻找命名空间,

只需设置一个具有相同名称的程序集的引用(通常)。

例如,如果我有...

Begin Namespace MyNamespace.SubSpace

结束命名空间

我可以把它放在名为''core.dll''的程序集中。所以我会引用Core,但是导入MyNamespace.SubSpace?


确实。

虽然不是什么大不了的事,但我想我想保持dll名称与实际名称空间有点不同,例如spcore,
spui,spetc......
I think I might be on track to a misnomer that I keep running
into.

A lot of the assemblies that I reference are named "System",
"System.Drawing", etc. There are dlls, ie, system.dll and
system.drawing.dll", etc. However, in my Imports statements, I also
use Import System and Import System.Drawing, which I assume are
''namespaces''.

So, is it that Microsoft just wanted to confuse us by naming them the
same, or is there some direct relation?
No, they wanted to make it easier. If you are looking for a namespace,
simply set a reference to a assembly with the same name (usually).
For example, if I have...

Begin Namespace MyNamespace.SubSpace

End Namespace

Can I put that in an assembly called ''core.dll''. So I would
reference Core, but Import MyNamespace.SubSpace?
Exactly.
Although not a big deal, I think I would like to keep the dll names a
little bit different than the actually namespaces, such as "spcore",
"spui", "spetc"...




我认为不同。 ;-)

-

Armin



I think different. ;-)
--
Armin


谢谢阿明,这已经清理了我个人的误解很大。

我通常会同意你保持基本名称空间相同的

作为程序集名称,但是,他有非常大,强大和偷偷摸摸的

竞争对手谁愿意得到我们的专有调度

算法,所以我的老板只是有点恐慌。 - 因此,我还要从抢占式软件中查看dotfuscator。


我们所有的程序集都是私有程序集,所以没有问题

第三方必须使用它们。

现在,这是一个问题...


你能拥有应用程序目录中私有程序集的库,但

创建一个全局程序集,提供一个围绕私有

程序集的包装器 - 这样可以将某些代码暴露给第三方想要

整合吗?


" Armin Zingler" < AZ ******* @ freenet.de>在消息中写道

news:eu ************** @ TK2MSFTNGP09.phx.gbl ...
Thank you Armin, this has cleared up a big misunderstanding on my part.
I would normally agree with you regarding keeping base namespaces the same
as assembly names, however, he have very big, powerful and sneaky
competitors who would love to get ahold of our proprietary scheduling
algorithms, so my bosses are just a little panicky. -- thus, I have also
been looking into the dotfuscator from preemptive software.

All of our assemblies will be private assemblies, so there is not an issue
with 3rd parties having to use them.
Now, here is a question...

Can you have a library of private assemblies in your app directories, but
create a global assembly that provides a wrapper around the private
assemblies -- such to expose certain code to 3rd parties who may want to
integrate?

"Armin Zingler" <az*******@freenet.de> wrote in message
news:eu**************@TK2MSFTNGP09.phx.gbl...
" Richard Brown" < RB **** @ easylift.org> schrieb
"Richard Brown" <rb****@easylift.org> schrieb
我想我可能会对我一直运行的用词不正确。

我引用的很多程序集都命名为System ;,
System.Drawing等。有dll,即system.dll和
system.drawing.dll等等。但是,在我的Imports语句中,我也是
使用导入系统和导入System.Drawing,我假设它是''名称空间''。

那么,微软是否只是想通过命名它们来混淆我们
相同,还是有一些直接关系?
I think I might be on track to a misnomer that I keep running
into.

A lot of the assemblies that I reference are named "System",
"System.Drawing", etc. There are dlls, ie, system.dll and
system.drawing.dll", etc. However, in my Imports statements, I also
use Import System and Import System.Drawing, which I assume are
''namespaces''.

So, is it that Microsoft just wanted to confuse us by naming them the
same, or is there some direct relation?



不,他们想让它变得更容易。如果您正在寻找命名空间,
只需设置一个具有相同名称的程序集的引用(通常)。



No, they wanted to make it easier. If you are looking for a namespace,
simply set a reference to a assembly with the same name (usually).

例如,如果我有......

Begin Namespace MyNamespace.SubSpace

结束命名空间

我可以把它放在名为''core.dll''的程序集中。所以我会引用Core,但是导入MyNamespace.SubSpace?
For example, if I have...

Begin Namespace MyNamespace.SubSpace

End Namespace

Can I put that in an assembly called ''core.dll''. So I would
reference Core, but Import MyNamespace.SubSpace?



正好。



Exactly.

虽然不是什么大不了的事,但我认为我想保持dll名称与实际名称空间略有不同,例如spcore,
spui,spetc......
Although not a big deal, I think I would like to keep the dll names a
little bit different than the actually namespaces, such as "spcore",
"spui", "spetc"...



我觉得与众不同。 ;-)

-
Armin



I think different. ;-)
--
Armin



嗨理查德,


||你可以在你的应用程序中拥有一个私人程序集库

||目录,但创建一个提供

||的全局程序集私有程序集周围的包装器。


我想象全局程序集中的所有直接引用都必须是其他全局程序集。它有点打破

全球化的精神,否则。


这就是说,没有理由你不应该与你的私人联系动态组装。接下来的问题是如何。 (并且

它不适合我)


问候,

Fergus
Hi Richard,

|| Can you have a library of private assemblies in your app
|| directories, but create a global assembly that provides a
|| wrapper around the private assemblies.

I would imagine that all direct references in a global assembly would have to be to other global assemblies. It kind of breaks
the spirit of being global, otherwise.

That said, there is no reason why you shouldn''t hook up to your private assemblies dynamically. The next question is how. (and
it''s not for me)

Regards,
Fergus


这篇关于程序集与命名空间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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