I have an ASP.NET MVC 5 application that is running on IIS and I want to use the Glimpse Package so that I can monitor all of the SQL calls that are being made within my application.
I have installed Glimpse using the Nuget Package Manager Console by using the command:
Install-Package Glimpse.MVC5
Since my application is running on IIS, I added the following commands to my web.config file:
<configuration>
<configSections>
<section name="glimpse" type="Glimpse.Core.Configuration.Section, Glimpse.Core" />
</configSections>
</configuration>
<system.web>
<httpModules>
<add name="Glimpse" type="Glimpse.AspNet.HttpModule, Glimpse.AspNet"/>
</httpModules>
<httpHandlers>
<add path="glimpse.axd" verb="GET" type="Glimpse.AspNet.HttpHandler, Glimpse.AspNet"/>
</httpHandlers>
</system.web>
<system.webServer>
<modules>
<add name="Glimpse" type="Glimpse.AspNet.HttpModule, Glimpse.AspNet" preCondition="integratedMode"/>
</modules>
<handlers>
<add name="Glimpse" path="glimpse.axd" verb="GET" type="Glimpse.AspNet.HttpHandler, Glimpse.AspNet" preCondition="integratedMode" />
</handlers>
</system.webServer>
After these commands are in place and I try running my application through IIS, I get the following error:
Could not load file or assembly 'Glimpse.AspNet' or one of its dependencies. The system cannot find the file specified.
I know that Glimpse is really set up to work by building your application locally but I think you can get it to work on a remote server as well.
Any help would be greatly appreciated!
I eventually got Glimpse up and running by making sure I installed all of the necessary NuGet packages for it.
I had this error on my local machine, and I was able to give the file permission, but how to solve this error on my host server
I tried to edit web.config, but I still have the same error
<configuration>
<system.web>
<customErrors mode="Off"/>
</system.web>
<system.webServer>
<httpErrors errorMode="Detailed" />
<asp scriptErrorSentToBrowser="true"/>
<handlers>
<add name="httpplatformhandler" path="*" verb="*" modules="httpPlatformHandler" resourceType="Unspecified" />
</handlers>
<httpPlatform processPath="..\approot\web.cmd" arguments="" stdoutLogEnabled="true" stdoutLogFile="..\logs\stdout.log" startupTimeLimit="3600"></httpPlatform>
</system.webServer>
</configuration>
Your host probably didn't install HttpPlatformHandler yet. Talk to them and not here.
[Updated: For RC2 and above, a new module is required instead of HttpPlatformHandler, https://github.com/aspnet/Announcements/issues/164]
An old story of everything works fine on the development machine but not on the host server.
HTTP Error 404.0 - Not Found
Module IIS Web Core
Notification MapRequestHandler
Handler StaticFile
Error Code 0x80070002
Trying to produce the same error on the development machine by adding <remove name="UrlRoutingModule-4.0" /> to system.webServer - modules and resolving it when adding <add name="UrlRoutingModule-4.0" type="System.Web.Routing.UrlRoutingModule" preCondition="" />, but that not works on the host. I've also try <modules runAllManagedModulesForAllRequests="true" /> but nothing changed.
And here is the handlers part:
<handlers>
<remove name="ExtensionlessUrlHandler-Integrated-4.0" />
<remove name="OPTIONSVerbHandler" />
<remove name="TRACEVerbHandler" />
<remove name="WebDAV" />
<add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="*" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" />
<add name="MiniProfiler" path="mini-profiler-resources/*" verb="*" type="System.Web.Routing.UrlRoutingModule" resourceType="Unspecified" preCondition="integratedMode" />
</handlers>
Few more information:
MVC.Net 5.2.2.0
IIS 7.5 on Windows 2008
Integrated .Net 4.0 application pool.
Is there anything else that I should do?
Now, having the same problem in IIS8, any idea?
I had similar problem. It turns out to be discrepancy with Virtual folder name and the URL I was constructing to call Web API route:
var URLGetUserAccesses = "/api/Login/GetUserAccesses";
Vs.
var URLGetUserAccesses = "../api/Login/GetUserAccesses";
I have an MVC4 application to which I added an HttpHandler:
<system.web>
...
<httpHandlers>
<add path="Files" verb="*" type="MyHttpHandler" />
</httpHandlers>
</system.web>
I also ignored the relevant path in RegisterRoutes so that the requests to "Files" are not handled by MVC:
routes.IgnoreRoute("Files/{*pathInfo}");
The problem is that the MyHttpHandler is invoked only for requests to "Files", not for any of its children or sub-folders.
I've tried using the <location> element, but getting that to work means that you will be hard coding the application's virtual path in the "path" attribute (e.g., <location path='MyApp\Files'>).
What is the correct method to use to allow all requests for "Files" and any of its sub-folders (and sub-folders of those folder, etc) to get routed to MyHttpHandler?
Scratch that...<location> seems to work OK. Though, you need both the <web> and <webServer> entries to ensure that it works for both IIS and the Visual Studio Development Server. For example:
<location path="Files">`
<system.webServer>
<handlers>
<add name="MyHandler" path="*" verb="*" type="MyHttpHandler" />
</handlers>
</system.webServer>
<system.web>
<httpHandlers>
<add path="*" verb="*" type="MyHttpHandler" />
</httpHandlers>
</system.web>
</location>
I am using Crystal reports viewer on a normal ASP.NET aspx page in an MVC3 application. In a controller action I am simply redirecting to the aspx page and the report shows fine. But the problem is with dynamic images. I have found the simplest solution for this and this to pass the image path as a report parameter and set this parameter as image source. In Visual Studio preview this works fine but when executing I see this error on the page.
"NetworkError: 404 Not Found -
server/ReportWebForms/CrystalImageHandler.aspx?dynamicimage=cr_tmp_image_4fbcb73a-e001-4365-84fc-164788dd1605.png"
So I assume, having no previous experience with crystal reports, that the problem is in CrystalImageHandler.aspx.
I have these entries in the Web.config:
<httpHandlers><add verb="GET" path="CrystalImageHandler.aspx" type="CrystalDecisions.Web.CrystalImageHandler, CrystalDecisions.Web, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/></httpHandlers></system.web>
<handlers><add name="CrystalImageHandler.aspx_GET" verb="GET" path="CrystalImageHandler.aspx" type="CrystalDecisions.Web.CrystalImageHandler, CrystalDecisions.Web, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304" preCondition="integratedMode"/></handlers></system.webServer>
Is this an MVC type of a problem? Can anyone help with this please?
THank you
I had the same problem, but fortunately I have some experience with Crystal Reports.
You just need to change the Web.config, because the "path" attribute is set to site root.
It will work if you open the url in browser and remove the ReportWebForms from it.
Actually I've just added 2 more lines of configuration:
<system.web>
<httpHandlers>
<add verb="GET" path="CrystalImageHandler.aspx" type="CrystalDecisions.Web.CrystalImageHandler, CrystalDecisions.Web, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304" />
<!-- Added -->
<add verb="GET" path="Reports/CrystalImageHandler.aspx" type="CrystalDecisions.Web.CrystalImageHandler, CrystalDecisions.Web, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304" />
<add verb="GET,HEAD" path="asset.axd" validate="false" type="Telerik.Web.Mvc.WebAssetHttpHandler, Telerik.Web.Mvc" />
</httpHandlers>
</system.web>
<system.webServer>
<handlers>
<add name="MiniProfiler" path="mini-profiler-resources/*" verb="*" type="System.Web.Routing.UrlRoutingModule" resourceType="Unspecified" preCondition="integratedMode" />
<add name="CrystalImageHandler.aspx_GET" verb="GET" path="CrystalImageHandler.aspx" type="CrystalDecisions.Web.CrystalImageHandler, CrystalDecisions.Web, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304" preCondition="integratedMode" />
<!-- Added -->
<add name="CrystalImageHandler.aspx_GETR" verb="GET" path="Reports/CrystalImageHandler.aspx" type="CrystalDecisions.Web.CrystalImageHandler, CrystalDecisions.Web, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304" preCondition="integratedMode" />
<remove name="asset" />
<add name="asset" preCondition="integratedMode" verb="GET,HEAD" path="asset.axd" type="Telerik.Web.Mvc.WebAssetHttpHandler, Telerik.Web.Mvc" />
</handlers>
</system.webServer>
And finally you have to add an ignore rule the route for MVC application:
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.IgnoreRoute("{resource}.aspx/{*pathInfo}");
// Here is added new ignore rule
routes.IgnoreRoute("Reports/{resource}.aspx/{*pathInfo}");
In my case I have a folder named Reports where the .aspx file is placed. I guess you should change this to ReportWebForms in your case.
In my case I only had to ignore MVC's routing.To add onto #Hovhannes solution.You should add this rule to Routeconfig.cs
routes.IgnoreRoute("{*allaspx}", new { allaspx = #".*(CrystalImageHandler).*" });
Use this code as CrystalImageHandler.aspx:
<%# Page Language="C#" AutoEventWireup="true" %>
<script runat="server" language="c#" >
protected void Page_Load(object sender, EventArgs e)
{
CrystalDecisions.Web.CrystalImageHandler handler = new CrystalDecisions.Web.CrystalImageHandler();
handler.ProcessRequest(this.Context);
}
</script>
Answers:
Add this in RouteConfig.cs file
routes.IgnoreRoute("Reports/{resource}.aspx/{*pathInfo}");
Note : "Reports" is the directory name which contains crystal reports viewing aspx page