简体   繁体   中英

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. Quartz.NET requires a library Common.Logging. This library introduces a conflict and breaks the Ektron code in App_Code/VBCode.

Eg the following code from 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). Is it possible to specify the priority on libraries? Or namespace an imported library?

Update The Utilities.vb code is written by 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. This is really a clash between 2 libraries - Ektron and 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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM