Wrox Programmer Forums
|
BOOK: ASP.NET Website Programming Problem-Design-Solution
This is the forum to discuss the Wrox book ASP.NET Website Programming: Problem - Design - Solution, Visual Basic .NET Edition by Marco Bellinaso, Kevin Hoffman; ISBN: 9780764543869
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: ASP.NET Website Programming Problem-Design-Solution section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 6th, 2004, 11:31 AM
Authorized User
 
Join Date: Jul 2003
Posts: 52
Thanks: 0
Thanked 0 Times in 0 Posts
Default Error--External Component

Hi,
I have built a page that is roughly equivalent to thePhile
page "NewsManager.Admin.Categories.aspx" I did successful
builds on the projects and then tried to run my page. I got
the following error msg:

<code>
Error

--------------------------------------------------------------------------------
An unexpected error has occurred on this page.The system administrators have been notified.

The error occurred in:
http://localhost/VendorScape/WebModu...anagement.aspx

Error Message:
External component has thrown an exception.

Error Stack:
System.Web.HttpException: External component has thrown an exception. ---> System.Web.HttpCompileException: External component has thrown an exception.
   at System.Web.Compilation.BaseCompiler.ThrowIfCompile rErrors(CompilerResults results, CodeDomProvider codeProvider, CodeCompileUnit sourceData, String sourceFile, String sourceString)
   at System.Web.Compilation.BaseCompiler.GetCompiledTyp e()
   at System.Web.Compilation.PageCompiler.CompilePageTyp e(PageParser pageParser)
   at System.Web.UI.PageParser.CompileIntoType()
   at System.Web.UI.TemplateParser.GetParserCacheItemThr oughCompilation()
   --- End of inner exception stack trace ---
   at System.Web.UI.TemplateParser.GetParserCacheItemInt ernal(Boolean fCreateIfNotFound)
   at System.Web.UI.TemplateParser.GetParserCacheItemWit hNewConfigPath()
   at System.Web.UI.TemplateParser.GetParserCacheItem()
   at System.Web.UI.TemplateControlParser.CompileAndGetP arserCacheItem(String virtualPath, String inputFile, HttpContext context)
   at System.Web.UI.TemplateControlParser.GetCompiledIns tance(String virtualPath, String inputFile, HttpContext context)
   at System.Web.UI.PageParser.GetCompiledPageInstanceIn ternal(String virtualPath, String inputFile, HttpContext context)
   at System.Web.UI.PageHandlerFactory.GetHandler(HttpCo ntext context, String requestType, String url, String path)
   at System.Web.HttpApplication.MapHttpHandler(HttpCont ext context, String requestType, String path, String pathTranslated, Boolean useAppConfig)
   at System.Web.MapHandlerExecutionStep.System.Web.Http Application+IExecutionStep.Execute()
   at System.Web.HttpApplication.ExecuteStep(IExecutionS tep step, Boolean& completedSynchronously)
</code>

Can anyone tell me where to look for the "external component" that is causing the problem?
Thx much,
Reid C.

R Corcoran, Jr.
__________________
Reid C.
 
Old May 11th, 2004, 12:29 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 124
Thanks: 0
Thanked 0 Times in 0 Posts
Default

These look like chain linked errors. Is there a problem with setting up your local host?

XUMUSKIEFAN
Wrox Moderator
 
Old May 12th, 2004, 12:32 AM
Authorized User
 
Join Date: Jul 2003
Posts: 52
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi,
thanks for the reply...I see no problem with the localhost...
the default, login, and registration pages I've constructed
all load fine when I run the appl. But this page does not load
and I get this message.
Also, can you tell me what to do so that I can generate the
detailed type of error message I'm used to seeing. I know that
thePhile has a custom error/appexception routine, but I would
like to turn that off, or whatever I need to do so that the
normal type of detailed asp.net error screen comes up that shows me
where in the page code the error originates.
Thx much
Reid C

R Corcoran, Jr.
 
Old May 12th, 2004, 12:55 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 124
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Have you looked at the other several posts about the "thePhile"? Several folks have had various problems and there are several resolutions in the posts.

XUMUSKIEFAN
Wrox Moderator
 
Old May 12th, 2004, 02:18 PM
Authorized User
 
Join Date: Jul 2003
Posts: 52
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Yes, thanks again for the reply...I have looked at all 15 pages since this forum is dedicated to thePhile. I have not seen this
problem. But someone who is very much familiar with the
architecture of thePhile might be also enough of an ASP.NET
expert (more than me) to suggest how I can read the error
message for clues, or how to configure the page to get more
error details.
It might help if this were forwarded to Charul or someone else
if necessary. Just a suggestion. Again, thanks for your attention.

R Corcoran, Jr.
 
Old May 12th, 2004, 10:09 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 917
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Try putting some Trace statements in this page:
http://www.fawcette.com/vsm/2002_02/...olumns/aspnet/
http://www.c-sharpcorner.com/Code/20...ngInASTNet.asp

Eric
 
Old May 13th, 2004, 11:03 AM
Authorized User
 
Join Date: Jul 2003
Posts: 52
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks, Eric...I'm going to try this. But can you tell me
something I'm confused about...
Do I get this type of error message because of thePhile's
custom applException routine and custom error tool?
I want, if possible, to get the 'standard' asp.net error
page that gives detailed compiler results and source so I
can see the line where the error came from. Is that
possible? Do I need to do something to temporarily enable this?
Like disable the site's custom error tool?
Thx much
Reid C.

R Corcoran, Jr.
 
Old May 13th, 2004, 10:13 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 917
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Are you using the C# or VB.NET version? I'm using the C# version, but I modified the error handling by taking the ideas from the VB.NET version - I'm logging to a file with common routines in PhilePage.cs. Here's an example:

public static void ShowError(Exception currentError)
{
  HttpContext context = HttpContext.Current;
  context.Response.Write(
    "<link rel=\"stylesheet\" href=\"/Styles/ThePhile.css\">" +
    "<h2>Error</h2>An unexpected error has occurred on this page. The system " +
    "administrators have been notified." +
    "<br/><b>The error occurred in: </b>" +
    "<pre>" + context.Request.Url.ToString() + "</pre><br/>" +
    "<br/><b>Error Message: </b>" +
    "<pre>" + currentError.Message.ToString() + "</pre>"+
    "<br/><b>Stack Trace:</b><br/>" +
    "<pre>" + currentError.ToString() + "</pre>");
}

See the .doc file in the VB.NET code download for a full description of this.

From looking at your stack trace again, it almost looks like a compile error. Does this error come BEFORE the page is displayed - in other words, do you see the page before the error occurs? I'd probably write a batch file to compile the .aspx file manually, just to see if that might reveal a problem.

Eric

Eric
 
Old May 14th, 2004, 10:54 AM
Authorized User
 
Join Date: Jul 2003
Posts: 52
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Eric,
thanks again...I'm using VB version. No, I do not ever see the
page. Also, I have noticed something else...on my 'new.aspx'
page, the "Register" button tag--in the html--looks like this:

<asp:Button id="Register" runat="server" Text="Register New User" />

...it has no reference to the "Register_Click" subroutine in the code
behind page ("OnClick="Register_Click"), but the page loads. But when I try to load the textboxes and then hit the button, I get an error message "object reference not set to an instance of an object"
or something like that. Then when I put in the 'OnCLick="Register_Click"', I get the "external component threw an exception" error just like I do in my other page! Wierd!

I also have to ask a dumb question--when I "run" or "build" the entire file (solution) from VS.Net, does it compile ALL the dll's I need to have to run with...because you mentioned compiling the page manually...but I don't ever see a dll for the ".aspx" page in question after I "build"...it's not in the /bin directory. Is there
compiling I need to do other than what the "build" command does for me? -- "Login.aspx" and "default.aspx" DO load just fine.

One other issue here--the reason there is not "OnClick" element to the Register button tag is that my WROX code download did not have this. Is this correct, or do I have a corrupted version (or maybe I inadvertently did something to it myself?)?

Sorry, I may possibly have some education issues here....

Thx,

R Corcoran, Jr.
 
Old May 16th, 2004, 10:36 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 917
Thanks: 0
Thanked 0 Times in 0 Posts
Default

There's 2 kinds of builds. The codebehind gets compiled into a DLL in VS when you do a build. The .aspx files are compiled into DLLs (that go into the temp file directory) at runtime when you bring up the page.

So, the compile errors you see in VS are only for the Code behind. The compile errors in the .aspx are only seen at runtime, assuming you have set up error handling to let you see it. The main config item is customErrors in web.config. To see detailed messages, you can set it like this:
<customErrors
    mode="Off"
    />
Or, set the mode to RemoteOnly if you are working on a local webserver.

But you also need to look at Global.asax.vb, and the other places where errors are handled to make sure the info will be reported. In the case of ThePhile, they went to great lengths to avoid people to see the full error info (it's ugly to end users and a big security risk).

To see how ASP.NET compiles your .aspx file, you should start with a different virtual directory. This way it won't use any error handling from ThePhile. Just create a new junk dir (call it c:\junk), right click, properties, web sharing, and share it as a virt dir named "junk".

You only need one file in this dir - name it junk.aspx:
<%@ Page language="vb" %>
<html>
<script runat="server">
 junk vb code
</script>
</html>

Now, bring up a web browser and hit the new page:
http://localhost/junk/junk.aspx

You should see "Server Error in '/junk' Application". Pay attention to this page - it tells you a LOT. Click on "Show Detailed Compiler output". This is showing you the actual commandline used to compile this page. Don't be put off by the long pathnames and the GUID-looking stuff. The "/r" options are referances made to other assemblies. Scroll to the right and you'll see the name of the temporary DLL it was making for this page: it's stored under "Temporary ASP.NET Files". Scroll a little farther to the right and you'll see the temporary VB filename - this represents your page (it won't look like your page because we didn't put any valid stuff here that you would recognize).

Now click on the link for "show complete compilation source". This shows the text of that temp VB file it made for you.

If you study the commandline, you can make your own batch file to compile the page manually. This has to be done with the actual page in ThePhile - not a copy in the temp dir. Just give it a name for the output DLL that won't conflict with anything important. You don't care about the output DLL, you are only trying to see the compile errors (if any).

By the way, you can prove that ThePhile's error handling code is hiding the compile errors if you just copy this junk.aspx page into ThePhile directory, then hit that page again: http://localhost/ThePhile/junk.apsx". Now you'll see a generic error and you won't be able to see the actual compile errors.

Instead of removing all the cool custom error handling code, it's easier to just compile the page yourself and look at the errors that way.

Eric





Similar Threads
Thread Thread Starter Forum Replies Last Post
CDOSYS Mail component error shrisangeeta Classic ASP Basics 1 May 5th, 2007 06:01 AM
Error installing COM component in system32 Abbas C# 3 September 20th, 2006 12:51 PM
CDO external email error in ASP Robert02 Classic ASP Professional 0 July 5th, 2006 04:28 PM
error LNK2019: unresolved external symbol tinawalt VS.NET 2002/2003 3 August 9th, 2005 07:59 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.