Converting System.Exception to System.Web.HttpCompileException in global.asax Application_Error - .NET 1.1

Hello.  I am capturing an exception in the above event handler using Server.GetLastError().  I would like to access the Results and SourceCode properties of an inner exception of type System.Web.HttpCompileException, but cannot do so, and am unable to implicitly convert a general exception to System.Web.HttpCompileException.  Any ideas?

 Thank you in advance,

Chris.

0
BIDeveloper
5/5/2008 4:00:00 PM
asp.net.getting-started 91979 articles. 3 followers. Follow

1 Replies
927 Views

Similar Articles

[PageSpeed] 53

Solved my own problem via the following code.  Feeling kind of embarrassed over the simple fix. 

if (lastErr.InnerException.GetType().ToString() == "System.Web.HttpCompileException")
{
	compileErr = lastErr.InnerException as HttpCompileException;

	errMsg += "Results: " + compileErr.Results + "<BR>";
	errMsg += "Source Code: " + compileErr.SourceCode + "<BR>";
}
 
0
BIDeveloper
5/5/2008 6:05:00 PM
Reply:

Similar Artilces:

IIS web page converted from 1.1 to 2.0 Security Exception System.Data.SqlClient.SqlClientPermission
Hi all, I have a working asp.net 1.1 application (VB.Net) that I attempted to convert to ASP.Net 2.0.  I have been able to eliminate all other issues except for the database error when I try and open a connection to the database. I tried strong naming, - didn't work.  I looked at Security Permision - but I couldn't make much sence out of it.  Plus I know the account it will be running under is the IIS account.  The application pool identity is "Network service".  (I'm not sure what "Network service" means; but I saw ...

Prior version of System.Web.Extensions v 1.0.61025.0
Okay its a long error msg and I am stuck on how to reset the ref to the new 3.5. I see the following refs on the same page... <%@ Register Assembly="System.Web.Silverlight" Namespace="System.Web.UI.SilverlightControls"TagPrefix="asp" %> <%@ Register Assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" Namespace="System.Web.UI" TagPrefix="asp" %> How do I change the referance?ThanksPhillip J. Hi,Please post your thread to the SilverLight forum http://silverli...

Error 1 The type 'System.Web.UI.WebControls.LinqDataSource' exists in both 'c:\WINDOWS\assembly\GAC_MSIL\System.Web.Extensions\3.5.0.0__31bf3856ad364e35\System.Web.Extensions.dll' and 'c:\WINDOWS\asse
Once I build project. I encounter this error. Does someone experience this error?Error    1    The type 'System.Web.UI.WebControls.LinqDataSource' exists in both 'c:\WINDOWS\assembly\GAC_MSIL\System.Web.Extensions\3.5.0.0__31bf3856ad364e35\System.Web.Extensions.dll' and 'c:\WINDOWS\assembly\GAC_MSIL\System.Web.Extensions\3.6.0.0__31bf3856ad364e35\System.Web.Extensions.dll'    D:\Source Code\Linq_Lesson5\Default.aspx    1    1    D:\Source Code\Linq_Lesson5\  It appears tha...

Why do I get this error: "Could not load file or assembly 'System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot f
I downloaded a reputed sample project and cant get it started because I am getting this error: Error 2 Could not load file or assembly 'System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified. D:\bills system\Bills Desktop\test\Dashboard\src\Dashboard\web.config 46  What can I do?  You need to install AJAX extensions for asp.net 2.0. You can get it here:http://www.asp.net/ajax/ Which version of Visual Studio are you using? If you are not us...

Unable to convert AJAX site in VS 2008, I get 'Could not load file or assembly 'System.Web.Extensions, Version=1.0.61025 error..'
This is the full message, i get one fore each ajax control on my site.  Error 1 Unable to create type 'cc1:TabContainer'. Could not load file or assembly 'System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified. V:\ASP\RemoteFitness3\Members\MembersHome.aspx 75  My web config is pointed to 3.5<add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>   And i have...

Could not load type System.Web.UI.WebControls.TreeView from assembly System.Web, Version=1.0.5000.0,
  Server Error in '/Demo1' Application. Parser Error Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately. Parser Error Message: Could not load type System.Web.UI.WebControls.TreeView from assembly System.Web, Version=1.0.5000.0, Culture=neutral, Source Error: Line 10: <form> Line 11: Line 12: <asp:TreeView runat="server"> Line 13: <Nodes> Line 14: <asp:TreeNode Text="Employees"">Sourc...

2.1.1 System Messages(used to be Exception Viewer)
Where is it? I have looked and looked, i even see in the sql script where it deletes the Exception View from all the tables but i don't see where it adds the new System Messages to the Modules table. Am I missing something? Or was it left out?Andrew RossPresidentDnn Coders Also after looking at both the sql script for both the Access and the SQL upgrade scripts it looks as if the the SQL script is missing all the upgraded GetSiteLog* scripts. In the Access upgrade it drops them all then adds updated ones, but the SQL script does not.Andrew RossPresidentDnn Coders System Messages isn't ...

[ 1.1.3883.1 ] -- System Menu flicker eliminated
Gang... This is just a quickie update to fix the System Menu flickering that Ian has reported. :) -- ________________________________________________________________ Steve. / Scarce as facts are, supply too often exceeds demand. It's as smooth as a baby's behind now! Did the fix just involve removing some code that was messing around with the menu during startup? JJ [for the unabridged version, see JuicyJ's post above] > It's as smooth as a baby's behind now! Did the fix just > involve removing some code that was messing around with > t...

Linq Error Cannot implicitly convert type 'System.Collections.Generic.IEnumerable<AnonymousType#1>' to 'System.Data.EnumerableRowCollection<System.Data.DataRow>'.
Hi I am using a AdventureWorks database and trying to use LINQ to query the data. i am not able to get the AsDataView() if i don't declare query as EnumerableRowCollection. But if i declare the query EnumerableRowCollection it shows me an error Cannot implicitly convert type 'System.Collections.Generic.IEnumerable' to 'System.Data.EnumerableRowCollection'. AdventureWorks.AdventureWorksDataContext db = new AdventureWorks.AdventureWorksDataContext(); EnumerableRowCollection query = from t in db.TransactionHistories.AsEnumerable() ...

Error 92 Could not load type 'System.Web.Hosting.HostingEnvironment' from assembly 'System.Web, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.
helloi'm a new  web developer i am trying to upgrad an esisting project fron visual studio 2003 to visual studio 2005 when trying to run the project i got that errorError    92    Could not load type 'System.Web.Hosting.HostingEnvironment' from assembly 'System.Web, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.        so ....any idea?  Hi tamer, It looks like Visual Studio 2005 is still trying to load the class in the 1.0 version of assemblies. Could you try removing the...

Could not load type 'System.Web.UI.Compatibility.CompareValidator' from assembly 'System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.
 Hello everyone.i m facing Required field validators problem  with ajax.Validators works fine in my application when it runs  frm localhostBut when I deployed the application on server it stops working.the thing i was missing  <tagMapping> tag.  <tagMapping>        <add tagType="System.Web.UI.WebControls.CompareValidator" mappedTagType="System.Web.UI.Compatibility.CompareValidator, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>   &n...

Error 92 Could not load type 'System.Web.Hosting.HostingEnvironment' from assembly 'System.Web, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. #2
hello :i am tying to upgrad an existing project from visual studio 2003 to visual studio 2005and i get the following errorrError    92    Could not load type 'System.Web.Hosting.HostingEnvironment' from assembly 'System.Web, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.        so does any one have any idea about the reason for it and how to fix it?  Hi, Please look at another of thread for more details: http://forums.asp.net/p/1210076/2139042.aspx#2139042Zhao Ji MaSincerely,Microsoft...

Could not load type 'System.Web.UI.Compatibility.CompareValidator' from assembly 'System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. (E:\SES3\Frontend\SESWe
After installingthe new Ajax release, I cannot compile my project. I tryied removing the <tagMapping>from the web.config, and was able to compile the project, BUT I go error on page: sys.argumentundefinedexception: value cannot be undefined. parameter name  Regards, Adina There is a known problem with the validators with the RTM.  More info about it here. I was getting the "Could not load type 'System.Web.UI.Compatibility.CompareValidator' from assembly 'System.Web.Extensions.." error too!  My project finally compiled correctly after removing the <tagMapping&g...

Problem with AjaxControl kit error Compiler Error Message: CS0433: The type 'System.Web.UI.ScriptManager' exists in both 'c:\WINDOWS\assembly\GAC_MSIL\System.Web.Extensions\1.0.61025.0__31bf3856ad364
I'm trying to use the Tabs from the Ajaxcontrol kit.I have installed Ajax WebExtension 1.0 to the server i'm runnig the apps fromI'm sure the version of my Ajaxcontrol kit and the System.Web.Extensions i'm trying to use is 1.0.61025. But it seems the one on 3.5 is also there since the server has been updated to v3.5 .net framework I get this error below:  Compiler Error Message: CS0433: The type 'System.Web.UI.ScriptManager' exists in both 'c:\WINDOWS\assembly\GAC_MSIL\System.Web.Extensions\1.0.61025.0__31bf3856ad364e35\System.Web.Extensions.dll...

System.Drawing Bug in Mono 1.1.12.1 resolution.
Hello all, For any of you that have been following my post regarding storing images into MYSQL on a mono based platform. I found a solution to my problem, and it was a simple as anything. Just to recap. My problem involved Mono's buggy System.Drawing class. I am running Mono 1.1.12.1 on Fedora 2 (I know pretty old, but works a treat).  My task was to create a new bitmap from an existing Jpeg, edit it and then save it to an absolute path on my server. The first problem I encountered was with the Bitmap.Save function System.Drawing.Bitmap newBit = new System.Drawing.Bitmap.FromFile("im...

Web resources about - Converting System.Exception to System.Web.HttpCompileException in global.asax Application_Error - .NET 1.1 - asp.net.getting-started

Resources last updated: 12/24/2015 1:53:46 PM