简体   繁体   English

在Unity中排除名称空间或程序集

[英]Exclude namespace or assembly in Unity

Im using Unity and get problem with one of our 3rd party controls. 我正在使用Unity并遇到我们的第三方控件之一的问题。 Can i exclude a namespace, so Microsoft Unity not include this? 我可以排除名称空间,因此Microsoft Unity不包括该名称空间吗?

This is the error message 这是错误消息

[ResolutionFailedException: Resolution of the dependency failed, type = "DevExpress.Web.Internal.TabItemSpacerControlLite", name = "(none)" [ResolutionFailedException:依赖关系的解析失败,类型=“ DevExpress.Web.Internal.TabItemSpacerControlLite”,名称=“(无)”

I found a solution. 我找到了解决方案。 One of the third party control had two constructors who took one parameter. 第三方控件之一具有两个采用一个参数的构造函数。 I had to specify which one to use. 我必须指定要使用哪个。

private static void RegisterDependencies(IUnityContainer container)
{
    // TODO: Add any dependencies needed here
    container
        .RegisterType(typeof(TabItemSpacerControlLite), typeof(TabItemSpacerControlLite), new InjectionConstructor(typeof(TabBase)));
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 命名空间还是程序集? - Namespace or Assembly? 命名空间Unity - Namespace Unity “找不到类型或名称空间名称。 您是否缺少程序集参考?” Unity中的错误 - “The type or namespace name could not be found. Are you missing assembly reference ?” Error in Unity Unity 2019 错误找不到类型或命名空间名称“NotSupportedException”(您是否缺少 using 指令或程序集引用?) - Unity 2019 error The type or namespace name 'NotSupportedException' could not be found (are you missing a using directive or an assembly reference?) 找不到类型或命名空间名称“ScriptName”(您是否缺少 using 指令或程序集引用?)修复 unity c# - The type or namespace name 'ScriptName' could not be found (are you missing a using directive or an assembly reference?) fix unity c# 获取加载程序集的根命名空间(程序集命名空间) - Get root namespace (assembly namespace) of loaded assembly AllowXRequestsEveryXSecondsAttribute的程序集和名称空间是什么? - What is the assembly and namespace of AllowXRequestsEveryXSecondsAttribute? 如何获取程序集的命名空间? - How to get Namespace of an Assembly? 命名空间是程序集还是项目? - Is a namespace an assembly, or a project? “程序集中不包含名称空间”问题 - “namespace is not included in the assembly” issue
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM