.dll file not recognized in bin folder.

G

Guest

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>
 
G

Guest

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!
***************************
 
G

Guest

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!
 
P

Patrick Olurotimi Ige

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
 
G

Guest

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
 
J

Juan T. Llibre [MVP]

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
===========
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,226
Members
46,815
Latest member
treekmostly22

Latest Threads

Top