Business Component missing dlls

T

tshad

I am trying to set up a reusable library (business component) that I can use
in a bunch of my pages.

I built the file and it almost compiles, but I am not sure what I am
missing.

The vbc command and results are:

************************************************************************
C:\Inetpub\wwwroot\Development>vbc /t:library emailClass.vb
/r:system.web.dll /r:system.data.dll

Microsoft (R) Visual Basic .NET Compiler version 7.10.6001.4
for Microsoft (R) .NET Framework version 1.1.4322.2032
Copyright (C) Microsoft Corporation 1987-2002. All rights reserved.

C:\Inetpub\wwwroot\Development\EmailClass.vb(20) : error BC30456:
'Configuration
Settings' is not a member of 'Configuration'.

Dim ConnectionString as String
=System.Configuration.ConfigurationSe
ttings.AppSettings("MM_CONNECTION_STRING_ftsolutions")
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~
C:\Inetpub\wwwroot\Development\EmailClass.vb(21) : error BC30007: Reference
requ
ired to assembly 'System' containing the base class
'System.ComponentModel.Compo
nent'. Add one to your project.

Dim objConn as New SqlConnection (ConnectionString)
~~~~~~~~~~~~~
C:\Inetpub\wwwroot\Development\EmailClass.vb(23) : error BC30007: Reference
requ
ired to assembly 'System' containing the base class
'System.ComponentModel.Compo
nent'. Add one to your project.

Dim objCmd as New SqlCommand(CommandText,objConn)
~~~~~~~~~~

C:\Inetpub\wwwroot\Development>
***************************************************************************

What dlls am I missing?

Thanks,

Tom
 
T

tshad

Btw,

What dlls do I need for sessions and trace? I was using the same vbc line
(with system.dll added - that worked fine), but added a couple of lines that
referenced my session variables as well as a couple of trace.warn
statements.

Thanks,

Tom
 
T

tshad

Where do I find which .dlls are needed with which object
(trace,session,application,asp:textbox etc)?

Is there a place that tells you this?

You need to know what imports to use in the .vb as well as the .dlls to
reference in the vbc line.

Thanks,

Tom
 
T

tshad

Juan T. Llibre said:
Session and Trace are in System.Web.dll.

But here I am getting errors from my compile and I do reference
System.Web.Dll.

Here are the imports:

Imports System
Imports System.Web.UI
Imports System.Web.SessionState
Imports System.Web.Mail
Imports System.Data
Imports System.Data.SqlClient
System.Diagnostics.Trace

I assume that System.Web.SessionState is what I need for Sessions? I also
thought that System.Diagnostics.Trace were what I needed for trace.warn.

Also I assume that I need some vb.dll to use left and intstr. I am not even
going to look at the others if the sessions and trace aren't working.

http://msdn.microsoft.com/library/d...tml/frlrfsystemdiagnosticstraceclasstopic.asp

Shows trace as being System.diagnostics.trace (or am I reading it wrong).

The command and results are:

****************************************************************************
**********
C:\Inetpub\wwwroot\Development>makeemailclass

C:\Inetpub\wwwroot\Development>vbc /t:library emailClass.vb
/r:system.web.dll /r:system.data.dll /r:system.dll
Microsoft (R) Visual Basic .NET Compiler version 7.10.6001.4
for Microsoft (R) .NET Framework version 1.1.4322.2032
Copyright (C) Microsoft Corporation 1987-2002. All rights reserved.

C:\Inetpub\wwwroot\Development\EmailClass.vb(20) : error BC30451: Name
'trace' i
s not declared.

trace.warn("inside SendTheEmail")
~~~~~
C:\Inetpub\wwwroot\Development\EmailClass.vb(44) : error BC30451: Name
'Left' is
not declared.

Left(request.path, InStrRev(request.path, "/") - 1)
~~~~
C:\Inetpub\wwwroot\Development\EmailClass.vb(44) : error BC30451: Name
'request'
is not declared.

Left(request.path, InStrRev(request.path, "/") - 1)
~~~~~~~
C:\Inetpub\wwwroot\Development\EmailClass.vb(44) : error BC30451: Name
'InStrRev
' is not declared.

Left(request.path, InStrRev(request.path, "/") - 1)
~~~~~~~~
C:\Inetpub\wwwroot\Development\EmailClass.vb(44) : error BC30451: Name
'request'
is not declared.

Left(request.path, InStrRev(request.path, "/") - 1)
~~~~~~~
C:\Inetpub\wwwroot\Development\EmailClass.vb(45) : error BC30002: Type
'StreamRe
ader' is not defined.

Dim objStreamReader as StreamReader
~~~~~~~~~~~~
C:\Inetpub\wwwroot\Development\EmailClass.vb(48) : error BC30451: Name
'File' is
not declared.

If File.exists(MapPath("..\automail\mail.htm")) then
~~~~
C:\Inetpub\wwwroot\Development\EmailClass.vb(48) : error BC30451: Name
'MapPath'
is not declared.

If File.exists(MapPath("..\automail\mail.htm")) then
~~~~~~~
C:\Inetpub\wwwroot\Development\EmailClass.vb(49) : error BC30451: Name
'File' is
not declared.

objStreamReader = File.OpenText(MapPath("mail.htm"))
~~~~
C:\Inetpub\wwwroot\Development\EmailClass.vb(49) : error BC30451: Name
'MapPath'
is not declared.

objStreamReader = File.OpenText(MapPath("mail.htm"))
~~~~~~~
C:\Inetpub\wwwroot\Development\EmailClass.vb(58) : error BC30451: Name
'session'
is not declared.

Dim mailTo as String = session("email") & "?subject=Re: Your job
applica
tion for the position of " & session("jobTitle")
~~~~~~~

C:\Inetpub\wwwroot\Development\EmailClass.vb(58) : error BC30451: Name
'session'
is not declared.

Dim mailTo as String = session("email") & "?subject=Re: Your job
applica
tion for the position of " & session("jobTitle")

~~~~~~~
C:\Inetpub\wwwroot\Development\EmailClass.vb(62) : error BC30451: Name
'session'
is not declared.

message.Body = resumeTop & "<br>For the Position of: <b>" &
session("job
Title") & "</b><br><br>"
~~~~~~~

C:\Inetpub\wwwroot\Development\EmailClass.vb(63) : error BC30451: Name
'request'
is not declared.

message.Body = message.Body & "For Applicant: " & "<a href='http://"
& r
equest.ServerVariables("SERVER_NAME") & "/" & URLPath &
"/displayAppResumeEE.as
px?JobID=" & session("JobID") & "'>" & session("firstName") & " " &
session("las
tName") & "</a>" & "<br>"

~
~~~~~~

C:\Inetpub\wwwroot\Development\EmailClass.vb(63) : error BC30451: Name
'session'
is not declared.

message.Body = message.Body & "For Applicant: " & "<a href='http://"
& r
equest.ServerVariables("SERVER_NAME") & "/" & URLPath &
"/displayAppResumeEE.as
px?JobID=" & session("JobID") & "'>" & session("firstName") & " " &
session("las
tName") & "</a>" & "<br>"

~~~~~~~

C:\Inetpub\wwwroot\Development\EmailClass.vb(63) : error BC30451: Name
'session'
is not declared.

message.Body = message.Body & "For Applicant: " & "<a href='http://"
& r
equest.ServerVariables("SERVER_NAME") & "/" & URLPath &
"/displayAppResumeEE.as
px?JobID=" & session("JobID") & "'>" & session("firstName") & " " &
session("las
tName") & "</a>" & "<br>"

~~~~~~~

C:\Inetpub\wwwroot\Development\EmailClass.vb(63) : error BC30451: Name
'session'
is not declared.

message.Body = message.Body & "For Applicant: " & "<a href='http://"
& r
equest.ServerVariables("SERVER_NAME") & "/" & URLPath &
"/displayAppResumeEE.as
px?JobID=" & session("JobID") & "'>" & session("firstName") & " " &
session("las
tName") & "</a>" & "<br>"
~~~~~~~

C:\Inetpub\wwwroot\Development\EmailClass.vb(64) : error BC30451: Name
'session'
is not declared.

message.Body = message.Body & "Email: " & "<a href=""mailto:" &
mailTo &
""">" & session("email") & "</a>." & "<br><br>"

~~~~~~~
C:\Inetpub\wwwroot\Development\EmailClass.vb(65) : error BC30451: Name
'request'
is not declared.

message.Body = message.Body & "<a href='http://" &
request.ServerVariabl
es("SERVER_NAME") & "/" & URLPath &
"/displayJobApplicants.aspx?referenceCode="
& session("ReferenceCode") & "&CommandName=Resumes&PositionID=" &
session("Posit
ionID") & "'>See all applicants for this postion</a>" & "<br><br>"
~~~~~~~

C:\Inetpub\wwwroot\Development\EmailClass.vb(65) : error BC30451: Name
'session'
is not declared.

message.Body = message.Body & "<a href='http://" &
request.ServerVariabl
es("SERVER_NAME") & "/" & URLPath &
"/displayJobApplicants.aspx?referenceCode="
& session("ReferenceCode") & "&CommandName=Resumes&PositionID=" &
session("Posit
ionID") & "'>See all applicants for this postion</a>" & "<br><br>"
~~~~~~~

C:\Inetpub\wwwroot\Development\EmailClass.vb(65) : error BC30451: Name
'session'
is not declared.

message.Body = message.Body & "<a href='http://" &
request.ServerVariabl
es("SERVER_NAME") & "/" & URLPath &
"/displayJobApplicants.aspx?referenceCode="
& session("ReferenceCode") & "&CommandName=Resumes&PositionID=" &
session("Posit
ionID") & "'>See all applicants for this postion</a>" & "<br><br>"



C:\Inetpub\wwwroot\Development>copy emailClass.dll bin\emailClass.dll
1 file(s) copied.

C:\Inetpub\wwwroot\Development>
****************************************************************************
***********

Thanks,

Tom
 
T

tshad

tshad said:
But here I am getting errors from my compile and I do reference
System.Web.Dll.

Here are the imports:

Imports System
Imports System.Web.UI
Imports System.Web.SessionState
Imports System.Web.Mail
Imports System.Data
Imports System.Data.SqlClient
System.Diagnostics.Trace

I did change the above to System.Diagnostics and didn't get the trace error,
but did get:

C:\Inetpub\wwwroot\Development\EmailClass.vb(20) : error BC30456: 'warn' is
not
a member of 'System.Diagnostics.Trace'.

Tom
 
J

Juan T. Llibre

See http://www.kbalertz.com/Feedback_327848.aspx
for sample code to use Trace in ASP.NET applications.

There are two Trace classes in the Microsoft .NET Framework library:
System.Diagnostics.Trace and System.Web.TraceContext.

These Trace classes are frequently confused with each other.
However, each one is used for a specific purpose.

You typically use the System.Diagnostics.Trace class to
debug console applications or Windows Forms applications.

You use System.Web.TraceContext only in Microsoft ASP.NET applications.

To display Trace.Write statements on an ASP.NET page from a Class Library,
you must use the System.Web namespace, as previously advised.
 
T

tshad

Juan T. Llibre said:
See http://www.kbalertz.com/Feedback_327848.aspx
for sample code to use Trace in ASP.NET applications.

That took care of the Trace function. I needed System.Web.

I also added System.IO, which took care of the StreamReader.

But I still can't seem to get rid of the Left, IntSrv, Session and Request
errors.

MS seems to say that System.Web.SessionState is what I need for session keys
(obviously, not the case). Here is the Imports as I have them now.

Imports System
Imports System.Web
Imports System.IO
Imports System.Web.UI
Imports System.Web.SessionState
Imports System.Web.Mail
Imports System.Data
Imports System.Data.SqlClient

What I should do is put all the possible ones in and start taking them out
until I get an error to find what is needed. I assume that I can have as
many as I want, even if not needed as it is compiled anyway.

Thanks,

Tom
 
T

tshad

I now have the following imports which took care of all my "not declared"
statements, except for the VB functions (left, Intsrv etc).

Imports System
Imports System.Web
Imports System.IO
Imports System.Web.UI
Imports System.Web.SessionState
Imports System.Web.Mail
Imports System.Data
Imports System.Data.SqlClient
Imports System.Web.HttpCookie
Imports System.Web.HttpCookieCollection
Imports System.Web.HttpResponse
Imports System.Web.HttpRequest
Imports System.Web.HttpApplication
Imports System.Web.HttpApplicationState

The only other problem, it seems, is the message:

C:\Inetpub\wwwroot\Development\EmailClass.vb(55) : error BC30469: Reference
to a
non-shared member requires an object reference.

If File.exists(MapPath("..\automail\mail.htm")) then

I am getting this for "MapPath", "Session" and "Request". I do have the sub
set as "Shared sub sendTheEmail( )". Which worked before when I was just
sending just a quick email.

How would I set up an object reference to these objects?

Or is my problem the Shared sub?

Thanks,

Tom
 
T

tshad

Ok,

I stripped down the file to:

Imports System
Imports System.Web
Imports System.IO
Imports System.Web.UI
Imports System.Web.SessionState
Imports System.Web.Mail
Imports System.Data
Imports System.Data.SqlClient
Imports System.Web.HttpCookie
Imports System.Web.HttpCookieCollection
Imports System.Web.HttpResponse
Imports System.Web.HttpRequest
Imports System.Web.HttpApplication
Imports System.Web.HttpApplicationState

Namespace MyComponents

Public Class Emails

Shared sub sendTheEmail( )
dim URLPath As String = Left(request.path, InStrRev(request.path, "/") -
1)
Dim objStreamReader as StreamReader
objStreamReader = File.OpenText(MapPath("mail.htm"))
end sub

End Class
End Namespace

And got the following errors:
*******************************************************************************************
C:\Inetpub\wwwroot\Development>vbc /t:library emailClass.vb
/r:system.web.dll /r
:system.data.dll /r:system.dll
Microsoft (R) Visual Basic .NET Compiler version 7.10.6001.4
for Microsoft (R) .NET Framework version 1.1.4322.2032
Copyright (C) Microsoft Corporation 1987-2002. All rights reserved.

C:\Inetpub\wwwroot\Development\EmailClass.vb(21) : error BC30451: Name
'Left' is
not declared.

dim URLPath As String = Left(request.path, InStrRev(request.path,
"/") -
1)
~~~~

C:\Inetpub\wwwroot\Development\EmailClass.vb(21) : error BC30469: Reference
to a
non-shared member requires an object reference.

dim URLPath As String = Left(request.path, InStrRev(request.path,
"/") -
1)
~~~~~~~

C:\Inetpub\wwwroot\Development\EmailClass.vb(21) : error BC30451: Name
'InStrRev
' is not declared.

dim URLPath As String = Left(request.path, InStrRev(request.path,
"/") -
1)
~~~~~~~~

C:\Inetpub\wwwroot\Development\EmailClass.vb(21) : error BC30469: Reference
to a
non-shared member requires an object reference.

dim URLPath As String = Left(request.path, InStrRev(request.path,
"/") -
1)
~~~~~~~

C:\Inetpub\wwwroot\Development\EmailClass.vb(23) : error BC30469: Reference
to a
non-shared member requires an object reference.

objStreamReader = File.OpenText(MapPath("mail.htm"))
~~~~~~~
******************************************************************************************

Tom
 
J

Juan T. Llibre

Request is available via System.Web.HttpRequest
Session is available via System.Web.SessionState.HttpSessionState

I don't know what "IntSrv" is. Is that a typo ?

"Left" should be available via Microsoft.VisualBasic.dll
 
T

tshad

Juan T. Llibre said:
Request is available via System.Web.HttpRequest
Session is available via System.Web.SessionState.HttpSessionState

I don't know what "IntSrv" is. Is that a typo ?

My mistake. It was InStr and InStrRev.
"Left" should be available via Microsoft.VisualBasic.dll

And the Class was Microsoft.VisualBasic. Now those are taken care of.

Now I need to find out about the non-shared object business.

Thanks,

Tom
 

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,994
Messages
2,570,222
Members
46,810
Latest member
Kassie0918

Latest Threads

Top