System.Configuration.ConfigurationSection 在类库下不可用
我正在将一项功能从 App_Code 目录迁移到一个单独的项目,该项目将构建一个由我的 Web 应用程序引用的类库。 App_Code 部分中的一个类继承了 System.Configuration.ConfigurationSection,如下所示:
Imports System.Configuration
Imports System.Web.Configuration
Imports Microsoft.VisualBasic
Namespace P10.WebStore
#Region "WebStore Section"
Public Class WebStoreSection
Inherits ConfigurationSection
我绝对无法让项目将 ConfigurationSection 识别为类。我在谷歌上搜索到的关于这个类的信息没有提到必须做任何特殊的事情才能使用它。是因为这是一个类库而不是 .exe 或其他东西吗?我很困惑。
I'm migrating a piece of functionality from my App_Code directory to a separate project that's going to build a class library to be referenced by my web app. One of my classes in the App_Code piece inherits form System.Configuration.ConfigurationSection, like so:
Imports System.Configuration
Imports System.Web.Configuration
Imports Microsoft.VisualBasic
Namespace P10.WebStore
#Region "WebStore Section"
Public Class WebStoreSection
Inherits ConfigurationSection
I absolutely cannot get the project to recognize ConfigurationSection as a class. Nothing I google about this class mentions having to do anything special to use it. Is it because this is a class library and not an .exe or somethign? I'm stumped.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
类型
ConfigurationSection
是在程序集System.Configuration
中找到。您是否在类库项目中添加了对该程序集的引用?The type
ConfigurationSection
is found in the assemblySystem.Configuration
. Did you add a reference to that assembly in your class library project?