gpt4 book ai didi

c# - 如何在 app.config 中指定类的类型?

转载 作者:太空狗 更新时间:2023-10-30 00:51:36 26 4
gpt4 key购买 nike

我想了解如何在 app.config 中引用一个类。在这种情况下,我想在 app.config 中配置和微软统一扩展

<extension type="?, ?" />

type="assemblyName, namespace.class" 吗?

最佳答案

您需要specify the fully qualified type name :

A fully qualified type name consists of an assembly name specification, a namespace specification, and a type name.

示例:

"System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"

在某些情况下,您只需要“命名空间+类型名称、程序集名称”:

"System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework"

关于c# - 如何在 app.config 中指定类的类型?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26162558/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com