D
David Thole
Hey all,
I'm still very new at all this, but am going through the ASP.net 2.0
unleashed book, first chapter and trying to program my own little form
emailer for fun. I tried following the code for their version in the
book to the best of my abiltiies, and came across issues, mostly that a
type was expected when trying to compile in MS Visual Studio 2002.
When my stuff wasn't working at all, I decided to try just using his
code almost exactly. I copied it from the CD to my folder, and edited
just the e-mail addresses to my very own so that it wasn't going
somewhere unexpected. The system it's on is Windows .net Server 2003
Standard. The error I got, when running the page was:
---BEGIN PASTE---
Compilation Error
Description: An error occurred during the compilation of a resource
required to service this request. Please review the following specific
error details and modify your source code appropriately.
Compiler Error Message: BC30182: Type expected.
Source Error:
Line 5:
Line 6: Sub Page_Load()
Line 7: Dim client As New SmtpClient()
Line 8: client.Host = "localhost"
Line 9: client.Port = 25
Source File: c:\inetpub\wwwroot\smtpclient\SendMail.aspx Line: 7
Show Detailed Compiler Output:
C:\WINDOWS\system32>
"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\vbc.exe" /t:library
/utf8output
/R:"C:\WINDOWS\assembly\GAC_32\System.Web\2.0.0.0__b03f5f7f11d50a3a\System.Web.dll"
/R:"C:\WINDOWS\assembly\GAC_MSIL\System.Xml\2.0.0.0__b77a5c561934e089\System.Xml.dll"
/R:"C:\WINDOWS\assembly\GAC_MSIL\System.Web.Mobile\2.0.0.0__b03f5f7f11d50a3a\System.Web.Mobile.dll"
/R:"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET
Files\smtpclient\8f865d90\1728c4ff\assembly\dl3\4de41090\1037aa00_40b8c601\smtpclient.DLL"
/R:"C:\WINDOWS\assembly\GAC_32\System.EnterpriseServices\2.0.0.0__b03f5f7f11d50a3a\System.EnterpriseServices.dll"
/R:"C:\WINDOWS\assembly\GAC_MSIL\System.Configuration\2.0.0.0__b03f5f7f11d50a3a\System.Configuration.dll"
/R:"C:\WINDOWS\assembly\GAC_MSIL\System\2.0.0.0__b77a5c561934e089\System.dll"
/R:"C:\WINDOWS\assembly\GAC_32\System.Data\2.0.0.0__b77a5c561934e089\System.Data.dll"
/R:"C:\WINDOWS\assembly\GAC_MSIL\System.Web.Services\2.0.0.0__b03f5f7f11d50a3a\System.Web.Services.dll"
/R:"C:\WINDOWS\assembly\GAC_MSIL\System.Drawing\2.0.0.0__b03f5f7f11d50a3a\System.Drawing.dll"
/R:"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET
Files\smtpclient\8f865d90\1728c4ff\App_global.asax.5w9amsgm.dll"
/out:"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET
Files\smtpclient\8f865d90\1728c4ff\App_Web_nfetm-v4.dll" /DEBUG=1
/debug+ /define:_MYTYPE=\"Web\"
/imports:Microsoft.VisualBasic,System,System.Collections,System.Collections.Specialized,System.Configuration,System.Text,System.Text.RegularExpressions,System.Web,System.Web.Caching,System.Web.SessionState,System.Web.Security,System.Web.Profile,System.Web.UI,System.Web.UI.WebControls,System.Web.UI.WebControls.WebParts,System.Web.UI.HtmlControls
"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET
Files\smtpclient\8f865d90\1728c4ff\App_Web_nfetm-v4.0.vb"
"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET
Files\smtpclient\8f865d90\1728c4ff\App_Web_nfetm-v4.1.vb"
Microsoft (R) Visual Basic Compiler version 8.0.50727.42
for Microsoft (R) .NET Framework version 2.0.50727.42
Copyright (c) Microsoft Corporation. All rights reserved.
c:\inetpub\wwwroot\smtpclient\SendMail.aspx(7) : error BC30182: Type expected.
Dim client As New SmtpClient()
\0----End Paste----
\0
I don't have the smtp mail setup on that server, but when trying my
other form I changed the host and ports accordlingly where it should
have used the mail server. I even had tcpdump running on the port
(running all this through parallels) and nothing was sent. For some
reason "SmtpClient" just doesn't work correctly. Is this because I
have an older version of Visual Studio (2002)? Should I consider
upgrading to 2005? I have a windows mobile 2005 PDA, which is the main
reason why I would want to get .net 2005 -- are there any other
advantages?
Thanks for your help on this error, my start with .net is a little
rough so far, but I'm hoping to get better as I progress through this
book. I apologize ahead of time if this question is too "newbie like".
Thanks,
David
I'm still very new at all this, but am going through the ASP.net 2.0
unleashed book, first chapter and trying to program my own little form
emailer for fun. I tried following the code for their version in the
book to the best of my abiltiies, and came across issues, mostly that a
type was expected when trying to compile in MS Visual Studio 2002.
When my stuff wasn't working at all, I decided to try just using his
code almost exactly. I copied it from the CD to my folder, and edited
just the e-mail addresses to my very own so that it wasn't going
somewhere unexpected. The system it's on is Windows .net Server 2003
Standard. The error I got, when running the page was:
---BEGIN PASTE---
Compilation Error
Description: An error occurred during the compilation of a resource
required to service this request. Please review the following specific
error details and modify your source code appropriately.
Compiler Error Message: BC30182: Type expected.
Source Error:
Line 5:
Line 6: Sub Page_Load()
Line 7: Dim client As New SmtpClient()
Line 8: client.Host = "localhost"
Line 9: client.Port = 25
Source File: c:\inetpub\wwwroot\smtpclient\SendMail.aspx Line: 7
Show Detailed Compiler Output:
C:\WINDOWS\system32>
"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\vbc.exe" /t:library
/utf8output
/R:"C:\WINDOWS\assembly\GAC_32\System.Web\2.0.0.0__b03f5f7f11d50a3a\System.Web.dll"
/R:"C:\WINDOWS\assembly\GAC_MSIL\System.Xml\2.0.0.0__b77a5c561934e089\System.Xml.dll"
/R:"C:\WINDOWS\assembly\GAC_MSIL\System.Web.Mobile\2.0.0.0__b03f5f7f11d50a3a\System.Web.Mobile.dll"
/R:"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET
Files\smtpclient\8f865d90\1728c4ff\assembly\dl3\4de41090\1037aa00_40b8c601\smtpclient.DLL"
/R:"C:\WINDOWS\assembly\GAC_32\System.EnterpriseServices\2.0.0.0__b03f5f7f11d50a3a\System.EnterpriseServices.dll"
/R:"C:\WINDOWS\assembly\GAC_MSIL\System.Configuration\2.0.0.0__b03f5f7f11d50a3a\System.Configuration.dll"
/R:"C:\WINDOWS\assembly\GAC_MSIL\System\2.0.0.0__b77a5c561934e089\System.dll"
/R:"C:\WINDOWS\assembly\GAC_32\System.Data\2.0.0.0__b77a5c561934e089\System.Data.dll"
/R:"C:\WINDOWS\assembly\GAC_MSIL\System.Web.Services\2.0.0.0__b03f5f7f11d50a3a\System.Web.Services.dll"
/R:"C:\WINDOWS\assembly\GAC_MSIL\System.Drawing\2.0.0.0__b03f5f7f11d50a3a\System.Drawing.dll"
/R:"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET
Files\smtpclient\8f865d90\1728c4ff\App_global.asax.5w9amsgm.dll"
/out:"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET
Files\smtpclient\8f865d90\1728c4ff\App_Web_nfetm-v4.dll" /DEBUG=1
/debug+ /define:_MYTYPE=\"Web\"
/imports:Microsoft.VisualBasic,System,System.Collections,System.Collections.Specialized,System.Configuration,System.Text,System.Text.RegularExpressions,System.Web,System.Web.Caching,System.Web.SessionState,System.Web.Security,System.Web.Profile,System.Web.UI,System.Web.UI.WebControls,System.Web.UI.WebControls.WebParts,System.Web.UI.HtmlControls
"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET
Files\smtpclient\8f865d90\1728c4ff\App_Web_nfetm-v4.0.vb"
"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET
Files\smtpclient\8f865d90\1728c4ff\App_Web_nfetm-v4.1.vb"
Microsoft (R) Visual Basic Compiler version 8.0.50727.42
for Microsoft (R) .NET Framework version 2.0.50727.42
Copyright (c) Microsoft Corporation. All rights reserved.
c:\inetpub\wwwroot\smtpclient\SendMail.aspx(7) : error BC30182: Type expected.
Dim client As New SmtpClient()
\0----End Paste----
\0
I don't have the smtp mail setup on that server, but when trying my
other form I changed the host and ports accordlingly where it should
have used the mail server. I even had tcpdump running on the port
(running all this through parallels) and nothing was sent. For some
reason "SmtpClient" just doesn't work correctly. Is this because I
have an older version of Visual Studio (2002)? Should I consider
upgrading to 2005? I have a windows mobile 2005 PDA, which is the main
reason why I would want to get .net 2005 -- are there any other
advantages?
Thanks for your help on this error, my start with .net is a little
rough so far, but I'm hoping to get better as I progress through this
book. I apologize ahead of time if this question is too "newbie like".
Thanks,
David