引用程序集和.config文件。 [英] Referencing assemblies and .config files.

查看:73
本文介绍了引用程序集和.config文件。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,刚刚进行远程处理和几个问题
与.net有关的
已经浮出水面。

首先我在设计师看到过对于命名空间和它的许多

相关的System.Runtime.Remoting类都可用,但某些

不是。需要添加对System.Runtime.Remoting的引用

使所有不可用的引用可用。现在虽然我(想)理解

为了让它的类

和其他成员接触到设计师而需要引用程序集的概念,我不能相当得到我的头

周围为什么某些类的某些命名空间是可用的和其他的

不是 - 直接引用这个程序集。这只是一个设计

问题,某些命名空间的某些部分已经暴露在某些

程序集中。有人可以解释这是如何工作的以及它为什么会这样做?


我的问题的第二部分涉及

配置文件的XML元素和属性。看了一下为远程配置存储某些预定义的

元素的例子,我发现必须有一些这种基于XML的语言的参考资源来配置东西在

运行时。例如,我可能已经知道如何在c#代码中注册客户端激活的

频道,但我怎么知道...

{snippet !!}

< channels>

< channel ref =" http"端口= QUOT; 1234" />

< / channels>

...会做同样的事情。因此必须有某个地方我可以看看这些东西吗?


提前感谢!

-

Br,

Mark Broadbent

mcdba,mcse + i

============ =

解决方案

1)

命名空间可以分布在多个程序集上。命名空间在程序集中并不存在 - 程序集中的每个类型恰好都有一个由几个部分组成的完全限定名称。因此,您可能会在一个程序集中看到一些System.Runtime.Remoting类型,而在另一个程序集中看到其他类型。


但是,我希望所有的System.Runtime.Remoting。 *类型将位于System.Runtime.Remoting.dll程序集中,即,我不明白如何在没有引用System.Runtime.Remoting.dll的情况下看到某些类型。尝试在你引用的程序集上运行ildasm.exe - 并查看它们包含的类型。


2)

我不是知道参考的位置。但除了标准之外,东西,它可以在该文件中添加您自己的配置信息,然后在运行时读取它。


Christian


- -


" Mark Broadbent"写道:

大家好,刚刚通过远程处理和一些与.net有关的问题已经浮出水面。
首先我见过在设计器中,对于命名空间及其许多相关的System.Runtime.Remoting类都可用,但某些
不是。需要添加对System.Runtime.Remoting的引用以使所有不可用的引用可用。现在虽然我(想)理解了一个装配需要被引用的概念,以便它的类和其他成员能够接触到设计师,但我无法理解我的想法。为什么某些类的某些命名空间是可用的而其他类的
不是 - 直接引用此程序集。这只是一个设计问题,即命名空间的某些部分已经在某些
程序集中公开。有人可以解释一下这是如何工作的以及它为什么会这样做?

我的问题的第二部分涉及配置文件的XML元素和属性。看了一个存储某些用于远程配置的预定义
元素的例子后,我发现必须有一些基于这种XML语言的参考类型来配置运行时的东西。例如,我可能已经知道如何在c#代码中注册客户端激活的
频道,但我怎么知道...
{snippet !!}
< channels>
< channel ref =" http"端口= QUOT; 1234" />
< / channels>
...会做同样的事情。因此,我必须在某个地方看到这些东西吗?

提前致谢!
-

Br,
马克Broadbent
mcdba,mcse + i
=============



1。我认为在单独的程序集中使用一些名称空间的权衡取决于程序集的大小以及引用它的可能性为b / b
。加载程序集需要花费时间,因此他们希望尽可能减小默认程序集的大小。命名空间如Remoting和

Windows.Forms是分离成单独的

程序集的理想选择,因为它们是大型命名空间,仅用于特定的

情况。


2.远程处理配置文件格式都记录在MSDN中。
http://msdn.microsoft.com/library/en...asp?frame=true


-

John Wood

电子邮件:名字,点,姓氏,来自priorganize.com

" Mark Broadbent" <无************ @ no-spam-please.com>在消息中写道

新闻:Ov ************** @ TK2MSFTNGP09.phx.gbl ...

大家好,刚开始目前通过远程处理和一些与.net相关的
问题已经浮出水面。
首先,我在设计人员中看到了命名空间及其许多相关的系统类.Runtime.Remoting可用,但某些
不是。需要添加对System.Runtime.Remoting的引用以使所有不可用的引用可用。现在虽然我(想)理解了为了让它的
类和其他成员接触到设计师而需要引用程序集的概念,我无法理解我的想法为什么某些类的某些命名空间是可用的而其他类的
不是 - 直接引用此程序集。这只是一个设计问题,即命名空间的某些部分已经在某些
程序集中公开。有人可以解释一下这是如何工作的以及它为什么会这样做?

我的问题的第二部分涉及配置文件的XML元素和属性。看了一个存储某些用于远程配置的预定义
元素的例子后,我发现必须有一些基于这种XML语言的参考类型来配置运行时的东西。例如,我可能已经知道如何在c#代码中注册客户端
激活的频道,但我怎么知道...
{snippet !!}
< channels>
< channel ref =" http"端口= QUOT; 1234" />
< / channels>
..会做同样的事情。因此,我必须在某个地方看到这些东西吗?

提前致谢!
-

Br,
马克Broadbent
mcdba,mcse + i
=============



1。有道理,认为这可能是理由。问题是我在哪里从最初的远程课程中选择

? - 猜测我会说有一个

System.Runtime.Remoting名称空间在mscorlib.dll中定义(我认为我这样说是自我引用)。当然,如果我通过

对象浏览器来看它肯定是这样的。


2.这个链接的Thx。我有点希望Xml文档中所有

命名空间/类配置的文档都在一个地方,但我想

我必须看看我能做什么逐个班级找到。这个起点仍然是




-

Br,

Mark Broadbent

mcdba,mcse + i

=============

" John Wood" < j@ro.com>在消息中写道

新闻:美国************** @ tk2msftngp13.phx.gbl ...

1.我认为在单独的程序集中使用一些名称空间的权衡
实际上已经达到了程序集的大小以及它被引用的可能性。加载程序集需要花费时间,因此他们希望尽可能减少默认程序集的
大小。像Remoting
和Windows.Forms这样的命名空间非常适合分成单独的
程序集,因为它们是大型名称空间,仅在特定的情况下使用。

2。远程配置文件格式全部记录在MSDN中。
http://msdn.microsoft.com/library/en...asp?frame=true
-
John Wood
电子邮件:名字,点,姓,在priorganize.com
马克布罗德本特 <无************ @ no-spam-please.com>在消息中写道
新闻:Ov ************** @ TK2MSFTNGP09.phx.gbl ...

大家好,刚刚通过远程处理关于.net的一般情况和一些


问题

已经浮出水面。
首先,我在设计师中看到了名称空间和许多
它的相关类System.Runtime.Remoting是可用的,但某些
不是。需要在
中添加对System.Runtime.Remoting的引用,以使所有不可用的引用可用。现在虽然我(想)
理解了一个装配需要被引用的概念,以便它的


和其他成员被暴露给设计师,我不能完全得到我的
为什么某些类的某些命名空间可用而其他的
不是 - 直接引用这个程序集。这只是
设计问题,命名空间的某些部分已在某些
程序集中公开。有人可以解释这是如何工作的以及为什么它已经完成了

我的问题的第二部分涉及到
配置文件的XML元素和属性。看了一个存储用于远程配置的某些预定义
元素的示例后,我发现必须有
这种基于XML的语言的某种参考,以便在运行时配置内容。例如,我可能已经知道如何在c#代码中注册客户端


激活的

频道,但我怎么知道...
{snippet! !}
< channels>
< channel ref =" http"端口= QUOT; 1234" />
< / channels>
..会做同样的事情。因此,必须有一个
的地方我可以看看这些东西吗?

提前感谢!
-

Br,
Mark Broadbent
mcdba,mcse + i
=============




Hi guys, just going through remoting at the moment and a couple of questions
relating to .net in general has surfaced.
Firstly I have seen in the designer that for the namespace and many of its
associated classes of System.Runtime.Remoting are available, but certain
ones are not. A reference to System.Runtime.Remoting needs to be added to
make available all the unavailable ones. Now although I (think) understand
the concept that an assembly needs to be referenced in order for its classes
and other members to be exposed to the designer, I cant quite get my head
around why some classes of certain namespaces are available and others
arent -until a reference is made to this assembly. Is this simply a design
issue that certain parts of a namespace have been exposed in certain
assemblies. Could someone explain how this works and why it has been done?

The second part of my question relates to XML elements and attributes of
config files. Having looked at an example of storing certain predefined
elements for remoting config it has occurred to me that there must be some
kind of reference for this XML based language to configure things at
runtime. For instance I might have known how to register a client activated
channel in c# code, but how would I have known that...
{snippet!!}
<channels>
<channel ref="http" port="1234" />
</channels>
...would have done the same thing. Therefore there must be somewhere that I
can look these things up?

thanks in advance!
--
Br,
Mark Broadbent
mcdba , mcse+i
=============

解决方案

1)
A namespace can be distributed over several assemblies. A namespace doesn''t really exist in an assembly - each type in the assembly just happen to have a fully qualified name that consists of several parts. Therefore, it''s possible that you see some System.Runtime.Remoting types in one assembly and others in another assembly.

However, I would expect all System.Runtime.Remoting.* types to be located in System.Runtime.Remoting.dll assembly, i.e., I don''t understand how you can see some of the types without a reference to System.Runtime.Remoting.dll. Try to run ildasm.exe on the assemblies that you do have references to - and see what types they contain.

2)
I don''t know where the reference is. But in addition to the "standard" stuff, it''s possible to add your own configuration information in that file and then read it at runtime.

Christian

---

"Mark Broadbent" wrote:

Hi guys, just going through remoting at the moment and a couple of questions
relating to .net in general has surfaced.
Firstly I have seen in the designer that for the namespace and many of its
associated classes of System.Runtime.Remoting are available, but certain
ones are not. A reference to System.Runtime.Remoting needs to be added to
make available all the unavailable ones. Now although I (think) understand
the concept that an assembly needs to be referenced in order for its classes
and other members to be exposed to the designer, I cant quite get my head
around why some classes of certain namespaces are available and others
arent -until a reference is made to this assembly. Is this simply a design
issue that certain parts of a namespace have been exposed in certain
assemblies. Could someone explain how this works and why it has been done?

The second part of my question relates to XML elements and attributes of
config files. Having looked at an example of storing certain predefined
elements for remoting config it has occurred to me that there must be some
kind of reference for this XML based language to configure things at
runtime. For instance I might have known how to register a client activated
channel in c# code, but how would I have known that...
{snippet!!}
<channels>
<channel ref="http" port="1234" />
</channels>
...would have done the same thing. Therefore there must be somewhere that I
can look these things up?

thanks in advance!
--
Br,
Mark Broadbent
mcdba , mcse+i
=============



1. I think the trade-off of having some namespaces in separate assemblies is
really down to the size of the assembly and the likelihood that it will be
referenced. Loading an assembly takes time, so they want to reduce the size
of the default assemblies as much as possible. Namespaces like Remoting and
Windows.Forms are great candidates for splitting off into separate
assemblies because they are large namespaces and used only in specific
circumstances.

2. The remoting configuration file format is all documented in MSDN.
http://msdn.microsoft.com/library/en...asp?frame=true

--
John Wood
EMail: first name, dot, last name, at priorganize.com
"Mark Broadbent" <no************@no-spam-please.com> wrote in message
news:Ov**************@TK2MSFTNGP09.phx.gbl...

Hi guys, just going through remoting at the moment and a couple of questions relating to .net in general has surfaced.
Firstly I have seen in the designer that for the namespace and many of its
associated classes of System.Runtime.Remoting are available, but certain
ones are not. A reference to System.Runtime.Remoting needs to be added to
make available all the unavailable ones. Now although I (think) understand
the concept that an assembly needs to be referenced in order for its classes and other members to be exposed to the designer, I cant quite get my head
around why some classes of certain namespaces are available and others
arent -until a reference is made to this assembly. Is this simply a design
issue that certain parts of a namespace have been exposed in certain
assemblies. Could someone explain how this works and why it has been done?

The second part of my question relates to XML elements and attributes of
config files. Having looked at an example of storing certain predefined
elements for remoting config it has occurred to me that there must be some
kind of reference for this XML based language to configure things at
runtime. For instance I might have known how to register a client activated channel in c# code, but how would I have known that...
{snippet!!}
<channels>
<channel ref="http" port="1234" />
</channels>
..would have done the same thing. Therefore there must be somewhere that I
can look these things up?

thanks in advance!
--
Br,
Mark Broadbent
mcdba , mcse+i
=============



1. makes sense, thought that might be reason. Question is where am I picking
up the initial remoting classes from? -At a guess I''d say there is a
System.Runtime.Remoting namespace defined in mscorlib.dll (which I think Im
right in saying is referenced automatically). Certainly if I look at it thru
object browser it certainly seems that way.

2. Thx for this link. I was kind of hoping the documentation for all
namespaces/ classes config in Xml docs would be in one place but I guess
I''ll have to see what I can find on a class by class basis. Still thx for
this starting point.

--
Br,
Mark Broadbent
mcdba , mcse+i
=============
"John Wood" <j@ro.com> wrote in message
news:uS**************@tk2msftngp13.phx.gbl...

1. I think the trade-off of having some namespaces in separate assemblies is really down to the size of the assembly and the likelihood that it will be
referenced. Loading an assembly takes time, so they want to reduce the size of the default assemblies as much as possible. Namespaces like Remoting and Windows.Forms are great candidates for splitting off into separate
assemblies because they are large namespaces and used only in specific
circumstances.

2. The remoting configuration file format is all documented in MSDN.
http://msdn.microsoft.com/library/en...asp?frame=true
--
John Wood
EMail: first name, dot, last name, at priorganize.com
"Mark Broadbent" <no************@no-spam-please.com> wrote in message
news:Ov**************@TK2MSFTNGP09.phx.gbl...

Hi guys, just going through remoting at the moment and a couple of


questions

relating to .net in general has surfaced.
Firstly I have seen in the designer that for the namespace and many of its associated classes of System.Runtime.Remoting are available, but certain
ones are not. A reference to System.Runtime.Remoting needs to be added to make available all the unavailable ones. Now although I (think) understand the concept that an assembly needs to be referenced in order for its


classes

and other members to be exposed to the designer, I cant quite get my head around why some classes of certain namespaces are available and others
arent -until a reference is made to this assembly. Is this simply a design issue that certain parts of a namespace have been exposed in certain
assemblies. Could someone explain how this works and why it has been done?
The second part of my question relates to XML elements and attributes of
config files. Having looked at an example of storing certain predefined
elements for remoting config it has occurred to me that there must be some kind of reference for this XML based language to configure things at
runtime. For instance I might have known how to register a client


activated

channel in c# code, but how would I have known that...
{snippet!!}
<channels>
<channel ref="http" port="1234" />
</channels>
..would have done the same thing. Therefore there must be somewhere that I can look these things up?

thanks in advance!
--
Br,
Mark Broadbent
mcdba , mcse+i
=============




这篇关于引用程序集和.config文件。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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