GAC中的共享程序集及其依赖项程序集 [英] Shared Assembly in GAC and its dependencies assemblies

查看:109
本文介绍了GAC中的共享程序集及其依赖项程序集的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




我们在GAC中添加了一个共享程序集,以便我们的多个解决方案

可以使用它。我们使用发布者策略来控制程序集的不同版本。


这个共享程序集也有依赖项(有些是.NET程序集

具有强名称和一些非.NET没有强名称)。我们将如何管理依赖组件?
依赖程序集是否需要将
添加到GAC中?


显然我们无法将弱名称程序集添加到GAC中。 />
我们怎样才能管理弱命名程序集的一个副本,以便我们以后可以更新



我们宁愿不做依赖程序集的本地引用

(即程序集将需要在解决方案安装中存在

文件夹),以便我们可以在需要时更新依赖程序集

没有更新每个解决方案。

示例:

Assembly1:依赖于Assembly2(强名称)& Assembly3(弱名

命名)。

Assembly1添加到GAC。我们是否还需要将Assembly2添加到GAC

? Assembly3的命名不强,我们将如何管理

Assembly3?每个解决方案是否需要

Assembly3的本地副本,还是可以添加到c:\program files \shared中。管理它

集中?

希望这有意义,并提前感谢您的建议。


问候,
MA

Hi,

We have added a shared assembly in GAC so that our multiple solutions
can use use it. We use the publisher policy to controls the different
versions of the assembly.

This shared assembly also has dependencies (some are .NET assembly
with strong name and some non .NET without strong name). How we will
manage the dependent assemblies? Does the dependent assemblies will
need to be added to the GAC?

Obviously we will not able to add the weak name assembly to the GAC.
How can we manage one copy of the weak named assembly so that we can
update in future?

We will prefer not make local references of the dependent assemblies
(i.e. assemblies will need to be exists in solution installation
folder) so that we can update the dependent assemblies if required
without updating each solution.
Example:
Assembly1: depend on Assembly2 (strong named) & Assembly3 (weak
named).
Assembly1 added to the GAC. Do we need to add the Assembly2 to the GAC
as well? The Assembly3 is not strong named, how we will manage the
Assembly3? Does each solution will need the local copy of the
Assembly3 or can we add to the "c:\program files\shared" and manage it
centrally?
Hope this make sense and thanks in advance for your suggestions.

Regards,
MA

推荐答案

感谢您的回复。


顺便说一下,我试过使用C#

编译器创建包装器程序集但没有任何成功。 C#编译器(CSC)需要一个

目标文件(我不确定要输入的目标文件是什么)。我想

将unmanaged.dll(用Delphi编写)添加到托管dll

(用C#编写)。有什么建议吗?


问候,

MA
Thanks for your response.

Btw, I have tried to create the wrapper assembly using the C#
compiler but without any success. The C# compiler (CSC) require a
target file (I am not sure what is the target file to enter). I want
to add the unmanaged.dll (written in Delphi) to the managed dll
(written in C#). Any suggestions?

Regards,
MA


再想一想......


我们可以将依赖程序集的本地副本添加到解决方案

安装文件夹中吗?例如,


我们有一个AssemblyA(用C#编写),我们已经添加到GAC。

AssemblyA有AssemblyB的引用(用Delphi编写)和

其他互操作程序集(非托管)。


我们可以将这些未管理的程序集的本地副本发送到

解决方案安装文件夹?装配加载程序如何工作

GAC中的AssemblyA但依赖项是在解决方案安装中

文件夹。


感谢你的意见。


问候,

MA
Just another thought....

Can we have the local copy of the dependent assembly to the solution
installation folder? For example,

We have a AssemblyA (written in C#) which we added to the GAC.
AssemblyA has the references of AssemblyB (written in Delphi) and
other interop assemblies (un-managed).

Can we have the local copy of these un-managed assmblies to the
solution installation folder? How the assembly loader will work where
the AssemblyA in GAC but the dependencies are in solution installation
folder.

Thanks for your advice.

Regards,
MA


" MA" < ma ******* @ gmail.comwrote in message

news:5b *********************** *********** @ s20g2000 prd.googlegroups.com ...
"MA" <ma*******@gmail.comwrote in message
news:5b**********************************@s20g2000 prd.googlegroups.com...

顺便说一下,我尝试使用C#创建包装程序集

编译器但没有任何成功。 C#编译器(CSC)需要一个

目标文件(我不确定要输入的目标文件是什么)。我想

将unmanaged.dll(用Delphi编写)添加到托管dll

(用C#编写)。有什么建议?
Btw, I have tried to create the wrapper assembly using the C#
compiler but without any success. The C# compiler (CSC) require a
target file (I am not sure what is the target file to enter). I want
to add the unmanaged.dll (written in Delphi) to the managed dll
(written in C#). Any suggestions?



为什么不在编译托管的.dll时使用/ linkresource?

Why not just use /linkresource when you compile your managed .dll?


这篇关于GAC中的共享程序集及其依赖项程序集的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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