Class Library can't be found!

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • StevieMars
    New Member
    • Mar 2010
    • 21

    #1

    Class Library can't be found!

    I have a web Application and have created a seperate class library project.

    I am trying to use the Class Library by referencing it in the Web Application. I am doing this by right clicking the web application and clicking 'Add Reference...'. I then browse to my Class library and click ok. This gets added to a Bin folder in my web application.

    The problem is I can't actually get any of the objects that are in the Clas Library. I have tried adding a using statement to the top of the page. It tells me that the object could not be found (are you missing a using directive or an assembly reference?)

    Can anyone tell me what I'm doing wrong?

    Steve
  • yarbrough40
    Contributor
    • Jun 2009
    • 320

    #2
    I get that problem too from time to time. Usually my problem is that I did not declare my class as public.

    Comment

    • Frinavale
      Recognized Expert Expert
      • Oct 2006
      • 9749

      #3
      :) That's a pretty good answer. If your class library doesn't have any public classes then no outside code can use the classes in your class library.

      The other thing I was thinking of is that you aren't including the namespace that the classes are in....


      -Frinny

      Comment

      • StevieMars
        New Member
        • Mar 2010
        • 21

        #4
        Was a namespace problem. I moved the code from one project to another and didn't set the namespace once it was moved. DOH!!!

        Cheers

        Comment

        Working...