3

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.

Daniel Imms
  • 47,944
  • 19
  • 150
  • 166
fr0man
  • 865
  • 3
  • 12
  • 27

1 Answers1

11

The type ConfigurationSection is found in the assembly System.Configuration. Did you add a reference to that assembly in your class library project?

Fredrik Mörk
  • 155,851
  • 29
  • 291
  • 343
  • Geez, that was it. Thanks. I added probably a dozen references to try and mirror the project it's coming from, but that wasn't one of them. I don't know why I didn't think to check that one. Oh, wait, yes I do: I'm a moron. Thanks! – fr0man Apr 30 '10 at 20:34
  • @fr0man I just had the exact same issue and fixed it by finding this question so your 'stupidity' helped me out! I wouldn't have thought such a common piece of functionality needed manually adding an assembly reference. – Mr. Boy May 13 '20 at 18:12