System.Configuration.ConfigurationSection在类库下不可用

fr0*_*man 2 vb.net asp.net 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
Run Code Online (Sandbox Code Playgroud)

我绝对不能让项目将ConfigurationSection识别为一个类.我没有关于这个课程的谷歌提到必须做任何特别的事情来使用它.是因为这是一个类库而不是.exe或somethign?我很难过.

Fre*_*örk 9

该类型ConfigurationSection在程序集中找到System.Configuration.您是否在类库项目中添加了对该程序集的引用?