【问题标题】:assembly reference in multi layer C# project多层 C# 项目中的程序集引用
【发布时间】:2016-11-19 09:46:18
【问题描述】:

我的多层项目有数据层、服务、面板。 dataLayer 引用到服务,服务引用到面板。我在数据层中有一个接口,比如

public interface IJournalEntity
{
   ...
}

我的服务有一个继承自 IJournalEntity 的类,

public class OfflinePaymentService : IOfflinePaymentService, IJournalEntity
{
...                
}

当我编译面板层时,unity config 引发错误以添加对数据层的引用,如果没有引用,我该如何解决?

【问题讨论】:

    标签: unity3d multi-layer


    【解决方案1】:

    如果没有引用,您将无法修复。如果您不引用它,您的项目将不知道该类型。

    一些类似的问题:

    1. Access interface methods without referring the class
    2. C# Use a class that implements an interface without adding a reference to the assembly that defines the interface

    如果您的数据层是在单独的 dll 中定义的,则需要将其放入 Assets/Plugins/。这适用于 Unity3D 4.x。 在 Unity3D 5.x 上,只需将 dll 放入 Assets 即可。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-06-24
      • 1970-01-01
      • 2012-04-01
      • 1970-01-01
      • 1970-01-01
      • 2016-01-13
      • 1970-01-01
      • 2012-08-21
      相关资源
      最近更新 更多