.dll file not recognized in bin folder.

Discussion in 'ASP .Net' started by =?Utf-8?B?amFzb25idXJyd2M4NA==?=, Dec 8, 2004.

  1. I'm new to asp.net so bare with me. I'm reading through the asp.net
    unleashed book and am to the section on creating classes. After creating a
    ..vb file which I can successfully compile and placing the .dll file in the
    bin directory I get the following error message: BC30002: Type 'Quote' is not
    defined. Adder is in the new namespace I created in the .dll file. I know
    that the coding is error free. I've check it over numerous times and even
    tried all the relavent examples in the book and get the same type error
    message.

    One other .dll problem I have had so far is reconizing the .dll file
    associated with Adp.net for Oracle but I solved this problem by copying the
    ..dll file directly to the bin folder.

    Any help would be greatly apprcieated!

    The code is as follows:

    Imports System

    Namespace myComponents

    Public Class Quote

    Dim myRand As New Random

    Public Function ShowQuote() As String
    Select myRand.Next( 3 )
    Case 0
    Return "Look before you leap"
    Case 1
    Return "Necessity is the mother of invention"
    Case 2
    Return "Life is full of risks"
    End Select
    End Function

    End Class

    End Namespace





    <%@ Import Namespace="myComponents" %>

    <Script Runat="Server">

    Sub Page_Load
    Dim myQuote As New Quote

    lblOutput.Text = myQuote.ShowQuote()
    End Sub

    </Script>

    <html>
    <head><title>ShowQuote.aspx</title></head>
    <body>

    And the quote is...
    <br>
    <asp:Label
    id="lblOutput"
    Runat="Server" />

    </body>
    </html>
    =?Utf-8?B?amFzb25idXJyd2M4NA==?=, Dec 8, 2004
    #1
    1. Advertising

  2. Either compile the ASP.NET application files or register the DLL in your
    web.config file. Adding the namespace helps reduce the amount of typing by
    adding a pointer to the namespace. It does not register the DLL with your
    app. This changes a bit under 2.0, but for 1.x, you have to tell it where the
    DLL resides if you "precompile" external assemblies and place them in the
    /bin folder.


    ---

    Gregory A. Beamer
    MVP; MCP: +I, SE, SD, DBA

    ***************************
    Think Outside the Box!
    ***************************

    "jasonburrwc84" wrote:

    > I'm new to asp.net so bare with me. I'm reading through the asp.net
    > unleashed book and am to the section on creating classes. After creating a
    > .vb file which I can successfully compile and placing the .dll file in the
    > bin directory I get the following error message: BC30002: Type 'Quote' is not
    > defined. Adder is in the new namespace I created in the .dll file. I know
    > that the coding is error free. I've check it over numerous times and even
    > tried all the relavent examples in the book and get the same type error
    > message.
    >
    > One other .dll problem I have had so far is reconizing the .dll file
    > associated with Adp.net for Oracle but I solved this problem by copying the
    > .dll file directly to the bin folder.
    >
    > Any help would be greatly apprcieated!
    >
    > The code is as follows:
    >
    > Imports System
    >
    > Namespace myComponents
    >
    > Public Class Quote
    >
    > Dim myRand As New Random
    >
    > Public Function ShowQuote() As String
    > Select myRand.Next( 3 )
    > Case 0
    > Return "Look before you leap"
    > Case 1
    > Return "Necessity is the mother of invention"
    > Case 2
    > Return "Life is full of risks"
    > End Select
    > End Function
    >
    > End Class
    >
    > End Namespace
    >
    >
    >
    >
    >
    > <%@ Import Namespace="myComponents" %>
    >
    > <Script Runat="Server">
    >
    > Sub Page_Load
    > Dim myQuote As New Quote
    >
    > lblOutput.Text = myQuote.ShowQuote()
    > End Sub
    >
    > </Script>
    >
    > <html>
    > <head><title>ShowQuote.aspx</title></head>
    > <body>
    >
    > And the quote is...
    > <br>
    > <asp:Label
    > id="lblOutput"
    > Runat="Server" />
    >
    > </body>
    > </html>
    >
    >
    >
    >
    >
    =?Utf-8?B?Q293Ym95IChHcmVnb3J5IEEuIEJlYW1lcikgLSBN, Dec 8, 2004
    #2
    1. Advertising

  3. Cowboy,

    Thanks for the help. The folder that I have the files located in doesn't
    have a web.config file and I did not build the file in Visual Studio so I'm
    not sure how to reconfigure. I do have some other folders that contain
    web.config files. What do I type to add the .dll to a web.config file? And
    should I create a web.config file in the folder that the .aspx file is
    located? Thanks again for you help!

    "Cowboy (Gregory A. Beamer) - MVP" wrote:

    > Either compile the ASP.NET application files or register the DLL in your
    > web.config file. Adding the namespace helps reduce the amount of typing by
    > adding a pointer to the namespace. It does not register the DLL with your
    > app. This changes a bit under 2.0, but for 1.x, you have to tell it where the
    > DLL resides if you "precompile" external assemblies and place them in the
    > /bin folder.
    >
    >
    > ---
    >
    > Gregory A. Beamer
    > MVP; MCP: +I, SE, SD, DBA
    >
    > ***************************
    > Think Outside the Box!
    > ***************************
    >
    > "jasonburrwc84" wrote:
    >
    > > I'm new to asp.net so bare with me. I'm reading through the asp.net
    > > unleashed book and am to the section on creating classes. After creating a
    > > .vb file which I can successfully compile and placing the .dll file in the
    > > bin directory I get the following error message: BC30002: Type 'Quote' is not
    > > defined. Adder is in the new namespace I created in the .dll file. I know
    > > that the coding is error free. I've check it over numerous times and even
    > > tried all the relavent examples in the book and get the same type error
    > > message.
    > >
    > > One other .dll problem I have had so far is reconizing the .dll file
    > > associated with Adp.net for Oracle but I solved this problem by copying the
    > > .dll file directly to the bin folder.
    > >
    > > Any help would be greatly apprcieated!
    > >
    > > The code is as follows:
    > >
    > > Imports System
    > >
    > > Namespace myComponents
    > >
    > > Public Class Quote
    > >
    > > Dim myRand As New Random
    > >
    > > Public Function ShowQuote() As String
    > > Select myRand.Next( 3 )
    > > Case 0
    > > Return "Look before you leap"
    > > Case 1
    > > Return "Necessity is the mother of invention"
    > > Case 2
    > > Return "Life is full of risks"
    > > End Select
    > > End Function
    > >
    > > End Class
    > >
    > > End Namespace
    > >
    > >
    > >
    > >
    > >
    > > <%@ Import Namespace="myComponents" %>
    > >
    > > <Script Runat="Server">
    > >
    > > Sub Page_Load
    > > Dim myQuote As New Quote
    > >
    > > lblOutput.Text = myQuote.ShowQuote()
    > > End Sub
    > >
    > > </Script>
    > >
    > > <html>
    > > <head><title>ShowQuote.aspx</title></head>
    > > <body>
    > >
    > > And the quote is...
    > > <br>
    > > <asp:Label
    > > id="lblOutput"
    > > Runat="Server" />
    > >
    > > </body>
    > > </html>
    > >
    > >
    > >
    > >
    > >
    =?Utf-8?B?amFzb25idXJyd2M4NA==?=, Dec 8, 2004
    #3
  4. jasonburrwc84,
    What are u using to build ur applications..?
    Beco is ur not using VS.NET u can import the .DLL by adding the
    Namespace on the top of the page..
    Then copy the .DLL to the bin folder of the WWWROOT..
    Hope this helps
    Patrick



    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
    Patrick Olurotimi Ige, Dec 8, 2004
    #4
  5. Thanks,

    I had the .dll file in a bin folder located in a sub directory under the
    wwwroot folder. When I created a Bin folder under the wwwroot and added the
    ..dll to it it worked.

    Thanks,

    Jason

    "Patrick Olurotimi Ige" wrote:

    > jasonburrwc84,
    > What are u using to build ur applications..?
    > Beco is ur not using VS.NET u can import the .DLL by adding the
    > Namespace on the top of the page..
    > Then copy the .DLL to the bin folder of the WWWROOT..
    > Hope this helps
    > Patrick
    >
    >
    >
    > *** Sent via Developersdex http://www.developersdex.com ***
    > Don't just participate in USENET...get rewarded for it!
    >
    =?Utf-8?B?amFzb25idXJyd2M4NA==?=, Dec 9, 2004
    #5
  6. That happened because the subdirectory
    under the wwroot folder was not marked as
    an application in the IIS Manager.

    If that subdirectory had beem marked as an application,
    or as a virtual directory, the bin directory under
    that subdirectory would have worked.




    Juan T. Llibre
    ===========
    "jasonburrwc84" <> wrote in message
    news:...
    > Thanks,
    >
    > I had the .dll file in a bin folder located in a sub directory under the
    > wwwroot folder. When I created a Bin folder under the wwwroot and added
    > the
    > .dll to it it worked.
    >
    > Thanks,
    >
    > Jason
    >
    > "Patrick Olurotimi Ige" wrote:
    >
    >> jasonburrwc84,
    >> What are u using to build ur applications..?
    >> Beco is ur not using VS.NET u can import the .DLL by adding the
    >> Namespace on the top of the page..
    >> Then copy the .DLL to the bin folder of the WWWROOT..
    >> Hope this helps
    >> Patrick
    >>
    >>
    >>
    >> *** Sent via Developersdex http://www.developersdex.com ***
    >> Don't just participate in USENET...get rewarded for it!
    >>
    Juan T. Llibre [MVP], Dec 9, 2004
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. BH
    Replies:
    4
    Views:
    701
    sampsons
    Jul 17, 2003
  2. Guenther Liebowitz
    Replies:
    2
    Views:
    355
  3. Rick Strahl [MVP]
    Replies:
    0
    Views:
    380
    Rick Strahl [MVP]
    Aug 15, 2003
  4. Richard
    Replies:
    5
    Views:
    1,883
    Patrick.O.Ige
    Aug 11, 2005
  5. anne001
    Replies:
    1
    Views:
    398
Loading...

Share This Page