相关疑难解决方法(0)

我可以在.NET配置部分中添加textnode而不是属性吗?

我目前有一个.NET自定义配置部分,如下所示:

<customSection name="My section" />
Run Code Online (Sandbox Code Playgroud)

我想要的是将它写为textnode(我不确定这是否是正确的术语?),如下所示:

<customSection>
  <name>My Section</name>
</customSection>
Run Code Online (Sandbox Code Playgroud)

我当前的customSection类看起来像这样:

public class CustomSection: ConfigurationSection {

  [ConfigurationProperty("name")]
  public String Name {
    get {
      return (String)this["name"];
    }
  }

}
Run Code Online (Sandbox Code Playgroud)

我该怎么做才能使它成为一个textnode?

c# asp.net configuration web-config

17
推荐指数
2
解决办法
3516
查看次数

标签 统计

asp.net ×1

c# ×1

configuration ×1

web-config ×1