无法使用类库中的Ektron Framework API [英] Unable to use Ektron Framework API from class library

查看:81
本文介绍了无法使用类库中的Ektron Framework API的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用Ektron v8.02,我创建了一个使用Ektron.Cms.Framework.Core.Content命名空间的简单类库.

Using Ektron v8.02, I've created a simple class library that makes use of the Ektron.Cms.Framework.Core.Content namespace.

我已经在解决方案中添加了一个控制台应用程序以帮助进行测试;在控制台应用程序中,我添加了对原始类库的项目引用和一个App.Config文件,并带有指向我们的dev Ektron数据库的相应Ektron.DbConnection连接字符串.

I've added a console app to the solution to help with testing; to the console app I added a project reference to the original class library and an App.Config file with the appropriate Ektron.DbConnection connection string pointing to our dev Ektron database.

简而言之,这是有问题的代码:

Briefly, here is the code in question:

用于测试的控制台应用

static void Main(string[] args) {
    MyClass instance = new MyClass();
}

课程库

public class MyClass {
    private Ektron.Cms.Framework.Core.Content.Content cAPI;

    public MyClass() {
        //** exception here **
        cAPI = new Ektron.Cms.Framework.Core.Content.Content();
    }
}

当我尝试创建Content API的新实例时,在MyClass构造函数中引发了异常. IncompatibleTypesException例外,其内容为:

An exception is thrown in the MyClass constructor when I try to create a new instance of the Content API. The exception is an IncompatibleTypesException which says:

在解析Ektron.Cms.IRequestInfoProvider的依赖项时,提供的类型与Ektron.Cms.IRequestInfoProvider不兼容.

While resolving dependencies for Ektron.Cms.IRequestInfoProvider, the provided type is not compatible with Ektron.Cms.IRequestInfoProvider.

Ektron Dev论坛有几个主题,此处此处提到了这个确切的问题,但是还没有解决方案发布.希望有人从类库中使用Framework API有经验,可以在这种情况下认识到这种情况,并在我致电Ektron支持人员之前提供一些建议.

The Ektron Dev forums have a couple of threads here and here that mention this exact problem, but no solutions have been posted. Hoping someone with experience using the Framework API from a class library will recognize this situation and offer some advice before I have to call Ektron support.

推荐答案

8.02版不提供此功能,但较新的版本(我认为v8.6 +)具有一组备用的"3层" dll.这些三层" dll使用WCF与工作区/数据库进行通信,因此它们不依赖于诸如HttpContext之类的Web东西.您可以在安装目录中找到文件.路径将类似于:C:\Program Files (x86)\Ektron\CMS400v86\startersites\3TierMin\Content

This wasn't available with version 8.02, but the newer versions (v8.6+ I think) have an alternate "3-tier" set of dlls. These "3-tier" dlls use WCF to communicate with the workarea/database, so they have no dependency on web stuff like HttpContext. You can find the files in the installation directory; the path will be something like: C:\Program Files (x86)\Ektron\CMS400v86\startersites\3TierMin\Content

在编写控制台应用程序来执行诸如导入或修改内容之类的操作时,我已经成功地使用了这些dll.您还需要携带一些额外的配置文件,我认为您需要一个AppSetting来指向您的中间层"(拥有您的工作区的Ektron站点)的网址.

I've used these dlls with great success when writing console apps to do things like import or modify content. There are a few extra config files you'll need to bring along, and I think you need an AppSetting that points to the url of your "middle tier" -- the Ektron site that has your workarea.

这篇关于无法使用类库中的Ektron Framework API的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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