如何仅使用 Castle Core 2.5.2 中的 DictionaryAdapter?
我想在已经使用 Castle Core 1.2 的旧应用程序中仅使用 Castle Core 2.5.2 中的 DictionaryAdapter。除了从源代码编译 DictionaryAdapter 之外,是否有办法将这些库的公共部分分开?
I want to use just the DictionaryAdapter from Castle Core 2.5.2 in an old app that already uses Castle Core 1.2. Is there a way to keep apart the common parts of these libraries, except compiling just DictionaryAdapter from source?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
由于我只有 VS2010 Express 版本,我很想使用 ilmerge 来仅公开
DictionaryAdapter
命名空间,但一件事导致了另一件事,我采取了另一条路线,由于Castle.Core.Smtp
存在于两个版本中:我从Castle.Core.dll
2.5.2.0 开始,只是将命名空间的第一部分重命名为Castle
到Castle252
,因此我可以在Castle.Core
1.2.0.0 中使用它,而不会发生任何冲突:如何更改 .NET 程序集的命名空间?
Since I have just the Express version of VS2010, I was tempted to use ilmerge to expose just the
DictionaryAdapter
namespace, but one thing led to another, and I took another route, sinceCastle.Core.Smtp
is present in both versions: I started fromCastle.Core.dll
2.5.2.0 and simply renamed the first part of the namespaces fromCastle
toCastle252
, so I can use it alongCastle.Core
1.2.0.0 without any conflict:How to Change Namespace of .NET Assembly?
我首先尝试将 Castle.Core 升级到 2.5.2,但您的问题是这会拖累其他依赖项。您可以尝试从源代码编译 DictionaryAdapter,它与 Castle.Core 的其余部分相当独立,因此应该不会有太大麻烦。
I'd try first upgrading Castle.Core to 2.5.2, but your problem is that this will drag other dependencies. You can try compiling DictionaryAdapter from source, it's fairly independent from the rest of Castle.Core so it shouldn't be much trouble.