简体   繁体   English

Ektron app_code和库之间的ASP.Net库名称冲突

[英]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.

相关问题 我的ASP.NET Web应用程序无法“找到”App_Code文件夹中的任何类..? - My ASP.NET Web Application cannot 'find' any of my classes in the App_Code folder ..? 有没有办法在不丢失会话状态的情况下修改 ASP.NET 应用程序中的 App_Code? - Is there any way to modify App_Code in an ASP.NET application without losing session state? ASP.NET自定义代码库的命名和引用 - ASP.NET Custom Code Library Naming and Referencing ASP.NET中的类库中的Webforms - Webforms in class library in asp.net ASP.NET页面模板库 - ASP.NET Page Templates Library 运行ASP.NET WebForms应用程序时从类库的代码中读取安全的.pem文件 - Reading a secure .pem file from a class library's code when running ASP.NET WebForms application 使用表单身份验证在ASP.NET Webforms App外部的类库中检索当前登录的用户ID - Retrieving the current logged in user's Id in a class library outside of an ASP.NET Webforms App using forms authentication asp.net路由问题和冲突 - asp.net routing issue and conflict ASP.Net Webforms应用程序和ASP.Net Web服务之间的身份验证问题 - Authentication problem between ASP.Net Webforms app and a ASP.Net webservice Asp.Net WebForms .Net Fwk 4.6.1:找不到System.Web.Helpers.AntiForgery库 - Asp.Net WebForms .Net Fwk 4.6.1: Can't find System.Web.Helpers.AntiForgery library
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM