我正在将一个功能从我的 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 或其他东西吗?我难住了。
最佳答案
型号 ConfigurationSection
在程序集中找到 System.Configuration
.您是否在类库项目中添加了对该程序集的引用?
关于asp.net - System.Configuration.ConfigurationSection 在类库下不可用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2747399/