Help Tracking Down an Application Error

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • tagg3rx
    New Member
    • Jun 2007
    • 35

    Help Tracking Down an Application Error

    Hi All,
    I recently implemented a global error catcher in my application that sends me an e-mail every time an error happens. One error I'm seeing regularly that I can't track down appears to have something to do with Crystal Reports. However no where in my application am I using Crystal Reports. I think it may be installed in the Library on my dev box and not on the servers (dev and prod both sending this error).

    Here is the error - I can't tell what is happening just prior to it being thrown and when I have asked uses what they were doing prior to getting it the response has been mixed.

    Code:
    URL: http://172.16.1.38/CrystalReportWebFormViewer/crystalimagehandler.aspx?dynamicimage=../../../../../../../../boot.ini
    Source: System.Web
    Message: The file '/CrystalReportWebFormViewer/crystalimagehandler.aspx' does not exist.
    Details: System.Web.HttpException: The file '/CrystalReportWebFormViewer/crystalimagehandler.aspx' does not exist. 
    at System.Web.UI.Util.CheckVirtualFileExists(VirtualPath virtualPath) 
    at System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile) 
    at System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile) 
    at System.Web.Compilation.BuildManager.GetVirtualPathObjectFactory(VirtualPath virtualPath, HttpContext context, Boolean allowCrossApp, Boolean noAssert) 
    at System.Web.Compilation.BuildManager.CreateInstanceFromVirtualPath(VirtualPath virtualPath, Type requiredBaseType, HttpContext context, Boolean allowCrossApp, Boolean noAssert) 
    at System.Web.UI.PageHandlerFactory.GetHandlerHelper(HttpContext context, String requestType, VirtualPath virtualPath, String physicalPath) 
    at System.Web.UI.PageHandlerFactory.System.Web.IHttpHandlerFactory2.GetHandler(HttpContext context, String requestType, VirtualPath virtualPath, String physicalPath) 
    at System.Web.HttpApplication.MapHttpHandler(HttpContext context, String requestType, VirtualPath path, String pathTranslated, Boolean useAppConfig) 
    at System.Web.HttpApplication.MapHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() 
    at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
  • Plater
    Recognized Expert Expert
    • Apr 2007
    • 7872

    #2
    Hmm strange indeed. Have you gone through all your pages/applications checking for unused references to crystalreports?
    Be sure to check for a DLL listed in the references as well as text in all your aspx and backend code pages. (Sometimes references are done "page-wise")

    I don't see any user code listed in the stack trace, only automatic .NET code, which is why I suspect a reference had been made to it somewhere.

    Comment

    • tagg3rx
      New Member
      • Jun 2007
      • 35

      #3
      I don't see any reference in the webconfig to anything that looks like Crystal Reports - I searched my entire Project for the term "Crystal" and came up null.

      Here is my Web Config for review (warning it's big)
      Code:
      <?xml version="1.0"?>
      <configuration>
      	<configSections>
      		<sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
      			<sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
      				<section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
      				<sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
      					<section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="Everywhere"/>
      					<section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
      					<section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
      					<section name="roleService" type="System.Web.Configuration.ScriptingRoleServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/></sectionGroup>
      			</sectionGroup>
      		</sectionGroup>
      	</configSections>
      
      	<system.web>
      		<customErrors mode="Off"/>
      		<compilation debug="true">
      			<assemblies>
      				<add assembly="System.DirectoryServices, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
      				<add assembly="System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
      				<add assembly="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
      				<add assembly="Microsoft.Office.Interop.Word, Version=11.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c"/>
      				<add assembly="Microsoft.Office.Interop.Excel, Version=11.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c"/>
      				<add assembly="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
      				<add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
      				<add assembly="System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
      				<add assembly="System.Data.DataSetExtensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
      				<add assembly="System.Web.Extensions.Design, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/></assemblies>
      		</compilation>
      		<httpHandlers>
      			<remove verb="*" path="*.asmx"/>
      			<add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
      			<add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
      			<add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" validate="false"/>
          </httpHandlers>
            
      		<httpModules>
      			<add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
      		</httpModules>
      		<authentication mode="Forms">
      			<forms name=".netopscookie" loginUrl="loginform.aspx" timeout="720"></forms>
      		</authentication>
      		<pages validateRequest="false" enableEventValidation="false" viewStateEncryptionMode="Never">
      			<controls>
      				<add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
      				<add tagPrefix="asp" namespace="System.Web.UI.WebControls" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/></controls>
      		</pages>
          <trace enabled="false" requestLimit="10" pageOutput="true" traceMode="SortByTime"/>
      	</system.web>
      	<appSettings>
      		<add key="FCKeditor:BasePath" value="~/FCKeditor/"/>
      		<add key="FCKeditor:UserFilesPath" value="~/FCKeditor/uploads/"/>
      	</appSettings>
      	<system.codedom>
      			<compilers>
      				<compiler language="c#;cs;csharp" extension=".cs" type="Microsoft.CSharp.CSharpCodeProvider,System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" warningLevel="4">
      					<providerOption name="CompilerVersion" value="v3.5"/>
      					<providerOption name="WarnAsError" value="false"/></compiler>
      				<compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" type="Microsoft.VisualBasic.VBCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" warningLevel="4">
      					<providerOption name="CompilerVersion" value="v3.5"/>
      					<providerOption name="OptionInfer" value="true"/>
      					<providerOption name="WarnAsError" value="false"/></compiler></compilers></system.codedom>
      	<system.webServer>
      			<validation validateIntegratedModeConfiguration="false"/>
      		<modules>
      			<remove name="ScriptModule"/>
      			<add name="ScriptModule" preCondition="managedHandler" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/></modules>
      		<handlers>
      			<remove name="WebServiceHandlerFactory-Integrated"/>
      			<remove name="ScriptHandlerFactory"/>
      			<remove name="ScriptHandlerFactoryAppServices"/>
      			<remove name="ScriptResource"/>
      			<add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
      			<add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
      			<add name="ScriptResource" verb="GET,HEAD" path="ScriptResource.axd" preCondition="integratedMode" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/></handlers></system.webServer>
      	<runtime>
      		<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      			<dependentAssembly>
      				<assemblyIdentity name="System.Web.Extensions" publicKeyToken="31bf3856ad364e35"/>
      				<bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/></dependentAssembly>
      			<dependentAssembly>
      				<assemblyIdentity name="System.Web.Extensions.Design" publicKeyToken="31bf3856ad364e35"/>
      				<bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/></dependentAssembly></assemblyBinding></runtime></configuration>

      Comment

      • Plater
        Recognized Expert Expert
        • Apr 2007
        • 7872

        #4
        Do any of those assemblies you are using require crystal reports? You have a lot of them.

        Comment

        • tagg3rx
          New Member
          • Jun 2007
          • 35

          #5
          Thats a great question - one to which i don't have an answer.

          Say that one does - I'm more interested to figure out how I get the needed files / GAC items over to the production server so this error stops as opposed to removing an assembly from the build.

          I searched My Dev box for a folder named CrystalReportWe bFormViewer
          I did find 2 in the c:\progra\micro soft\asp.net folder but neither folder contained a crystalimagehan dler.aspx, a subsequent search for crystalimagehan dler.aspx returned 0 hits.

          Comment

          • Plater
            Recognized Expert Expert
            • Apr 2007
            • 7872

            #6
            I've never sued crystal reports so I'm not sure.
            Your production server has ms office install though yes? (Since you reference them) Is there like a standalone isntaller for crystal reports?

            Comment

            • tagg3rx
              New Member
              • Jun 2007
              • 35

              #7
              Yea the prod server has MSOffice2k3 as well as the office interop assemblies.
              It would be a shame to have to buy a copy of crystal reports on this since I'm not actually using it.

              I found they offer a free viewer on there site - I'm going to download that and install it on the server see if i stop seeing the error

              Comment

              • Frinavale
                Recognized Expert Expert
                • Oct 2006
                • 9749

                #8
                Originally posted by tagg3rx
                Yea the prod server has MSOffice2k3 as well as the office interop assemblies.
                It would be a shame to have to buy a copy of crystal reports on this since I'm not actually using it.

                I found they offer a free viewer on there site - I'm going to download that and install it on the server see if i stop seeing the error
                Try going to your project's properties page and go to the References tab.
                There should be a list of all of the references that your project uses...the top right corner you'll see 2 buttons: "Unused References" and "Reference Paths".

                Click the "Unused References" button.
                There will be a list of references that are not used in your project displayed in a window....click "Remove" to remove them.

                Hopefully this will get rid of your unused crystal reports reference problem.

                -Frinny

                Comment

                • Plater
                  Recognized Expert Expert
                  • Apr 2007
                  • 7872

                  #9
                  I see the property page of the project. My window has no tabs. It's a list on the left with the "References " and there are no buttons that you mentioned.
                  I only have 3 total references though.
                  Have you moved on to vs2008 frinny?

                  Comment

                  • Frinavale
                    Recognized Expert Expert
                    • Oct 2006
                    • 9749

                    #10
                    Originally posted by Plater
                    I see the property page of the project. My window has no tabs. It's a list on the left with the "References " and there are no buttons that you mentioned.
                    I only have 3 total references though.
                    Have you moved on to vs2008 frinny?
                    Oh sorry, there's a difference between a Web Application and an ASP.NET Web Site....my instructions only work for Web Application projects.

                    ASP.NET Web Site projects are defaulted.
                    Although I don't know why...there's a lot more you can get out of a Web Application project (resolves namespace and refrence issues and all code compiles into one DLL...just handy all around)

                    :P

                    -Frinny

                    Comment

                    • Plater
                      Recognized Expert Expert
                      • Apr 2007
                      • 7872

                      #11
                      Originally posted by Frinavale
                      Oh sorry, there's a difference between a Web Application and an ASP.NET Web Site....my instructions only work for Web Application projects

                      :P

                      -Frinny
                      That too is complete news to me. I have no "web application" choice, just asp.net.
                      I always just assumed asp.net website/web application were used interchangably?
                      I require a screenshot as proof :-P

                      Comment

                      • Frinavale
                        Recognized Expert Expert
                        • Oct 2006
                        • 9749

                        #12
                        Originally posted by Plater
                        That too is complete news to me. I have no "web application" choice, just asp.net.
                        I always just assumed asp.net website/web application were used interchangably?
                        I added more to my post...re-read :)

                        Comment

                        • Frinavale
                          Recognized Expert Expert
                          • Oct 2006
                          • 9749

                          #13
                          Ok, apparently there's a difference between 2005 and 2008 regarding ASP.NET project types....

                          In 2008 there are 2 types:
                          Web Application and Web Site.

                          In 2008 the Web Site is the default one, the Web Application is more like the 2005's Asp.Net Web Application.

                          I went a bit nuts a few months back when I couldn't use namespace in my "Web Site" project and was double confused when I had functionality in the 2005 web app. that I didn't have in the 2008 Web Site.

                          I learned the difference between the two types of projects the hard way.

                          I just automatically assumed that 2005 Web App. had the same Project Reference options as the 2008 Web Application project had....looking at my 2005 project, I don't have the options I recommended above.


                          -Frinny

                          Comment

                          • Plater
                            Recognized Expert Expert
                            • Apr 2007
                            • 7872

                            #14
                            Hmm, so I am only using asp.net web sites then?
                            They show up as seperate "web applications" when you poke around in the IIS control viewer.

                            But as to the original problem, was there more to that stacktrace that didn't make it up?

                            Comment

                            • tagg3rx
                              New Member
                              • Jun 2007
                              • 35

                              #15
                              Hi all
                              My project's a web site, not a web project, I do have it on my todo list to upgrade to a web project because it does add some functionality - on the down site of the web projects you have to build em every time you want to see a change made in back end code.

                              As for my issue I came in this morning and had 15 more instances of the same error - The references listed in the properties are (as expected) the same ones listed in the Webconfig above - and I use all of them in one form or another so not really wanting to remove any.

                              I wish i could figure out what page was throwing the error as part of my error catcher that runs in the the global.asax I have this block:

                              Code:
                                      HttpContext _hContext = HttpContext.Current;
                                      Exception _ex = _hContext.Server.GetLastError();
                              
                                      StringBuilder _sbError = new StringBuilder();
                                      try { _sbError.Append("Current User: " + Request.Cookies["uName"].Value + "<br>"); }
                                      catch { }
                                      try { _sbError.Append("URL: " + _hContext.Request.Url.ToString() + "<br>"); }
                                      catch { }
                                      try { _sbError.Append("Source: " + _ex.Source + "<br>"); }
                                      catch { }
                                      try { _sbError.Append("Message: " + _ex.Message + "<br>"); }
                                      catch { }
                                      try { _sbError.Append("Details: " + _ex.ToString().Replace("\n", "<br>") + "<br><br><br>"); }
                                      catch { }
                              
                                      _hContext.Response.Write(_sbError.ToString());
                              but on this error i get only the Message and the details.
                              Any way to grab the browser history of like the last 4 pages?

                              Thanks.
                              Daniel

                              Comment

                              Working...