[英]ASP.Net Library name conflict between Ektron app_code and library
I've got an Ektron 8.2 site, and I was trying to integrate Quartz.NET into it, in order to run some scheduling. 我有一个Ektron 8.2网站,我试图将Quartz.NET集成到其中,以便进行一些调度。 Quartz.NET requires a library Common.Logging. Quartz.NET需要一个库Common.Logging。 This library introduces a conflict and breaks the Ektron code in App_Code/VBCode. 该库引入了冲突并破坏了App_Code / VBCode中的Ektron代码。
Eg the following code from Utilities.vb 例如,Utilities.vb中的以下代码
Case Is = Common.EkEnumeration.FolderType.Community
imageURL &= "images/ui/icons/folderCommunity.png"
Case Common.EkEnumeration.FolderType.Catalog
imageURL &= "images/ui/icons/folderGreen.png"
now gives a compile time error- 现在给出了编译时错误-
App_Code\VBCode\Utilities.vb(703,0): error BC30456: 'EkEnumeration' is not a member of 'Common'.
It appears that Common.Logging is conflicting with Ektron.Cms.Common (the Ektron files have a Imports Ektron.Cms
statement). 似乎Common.Logging与Ektron.Cms.Common冲突(Ektron文件具有Imports Ektron.Cms
语句)。 Is it possible to specify the priority on libraries? 是否可以指定库的优先级? Or namespace an imported library? 还是命名空间导入的库?
Update The Utilities.vb code is written by Ektron. 更新 Utilities.vb代码由Ektron编写。 I'd like to either make no changes to this code, or minimal changes, as any changes would need to be re-done upon Ektron upgrades. 我想对此代码不做任何更改,或进行最少的更改,因为任何更改都需要在Ektron升级后重新进行。 This is really a clash between 2 libraries - Ektron and Quartz.Net. 这实际上是2个库之间的冲突-Ektron和Quartz.Net。 Can I resolve this clash without changing the code of either library? 我可以在不更改任何一个库代码的情况下解决此冲突吗? Is there a configuration setting for aliasing libraries? 别名库是否有配置设置?
A simple solution is to use the full namespace, Ektron.Cms.Common.EkEnumeration, rather than relying on the include to sort things out automatically. 一个简单的解决方案是使用完整的命名空间Ektron.Cms.Common.EkEnumeration,而不是依靠include来自动整理内容。
Ie 即
Case Is = Ektron.Cms.Common.EkEnumeration...
Not elegant, but should get you working again. 不优雅,但是应该让您重新工作。
Another alternative is to use a namespace alias : 另一种选择是使用名称空间别名 :
using EkCommon = Ektron.Cms.Common;
So your code would instead look like: 因此,您的代码将改为:
EkCommon.EkEnumeration.FolderType.Community
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.