Telerik.Web.UI.WebResource.axd 500 (Internal Server Error) - c#

I am trying to deploy a C# .NET 4.5 application on IIS7 that uses Telerik UI. For some reason I am getting the following error when I navigate to my login page
GET http://localhost/dev/3pt_upgrade/portal/Automation_Framework/Telerik.Web.UI.WebResource.axd 500 (Internal Server Error)
I have tried everything on The Telerik Web Resources Troubleshooting guide
In my Web.config I have
<system.webServer>
<validation validateIntegratedModeConfiguration="false"/>
<modules runAllManagedModulesForAllRequests="true">
...
</modules>
<handlers>
<add path="ScriptResource.axd" verb="GET,HEAD" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=4.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" validate="false"/>
<add name="Telerik.Web.UI.WebResource" path="Telerik.Web.UI.WebResource.axd" verb="*" type="Telerik.Web.UI.WebResource, Telerik.Web.UI, Version=2013.3.1114.35, Culture=neutral, PublicKeyToken=121fae78165ba3d4"/>
</handlers>
</system.webServer>
Any insight on the matter would be truly appreciated.

Use Fiddler to see what error was thrown inside the .axd call. In my case was a bad path to telerik.common.css file.

Related

Web.config in Views subfolder ignored on developer machine, why?

I have an ASP.NET MVC application with a root web.config and a secondary Views/web.config added automatically by Visual Studio years ago when the application was created.
Now I have bumped ASP.NET MVC to a newer version (5.2.7), fixed various issues on my developer machine - and everything works for me.
Unfortunately, when pushed to our integration test server, everything fails as there are MVC version references, in the Views/web.config file, that are now invalid for the new MVC version.
I can fix the version issues and everything is 200 OK ... but, and here is my question, why doesn't the errors show up on my local developer machine?
It turns out I can introduce XML syntax errors and what not on my local machine - and nothing happens, everything is okay locally, as if the Views/web.config file is completely ignored by the webserver.
Both machines are running IIS on Windows with the same configuration ... well, except that something apparently is different.
Where should I look to figure out why the Views/web.config is ignored on my developer machine?
The Views/web.config looks like this (with the wrong version numbers included):
<?xml version="1.0"?>
<configuration>
<configSections>
<sectionGroup name="system.web.webPages.razor" type="System.Web.WebPages.Razor.Configuration.RazorWebSectionGroup, System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
<section name="host" type="System.Web.WebPages.Razor.Configuration.HostSection, System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />
<section name="pages" type="System.Web.WebPages.Razor.Configuration.RazorPagesSection, System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />
</sectionGroup>
</configSections>
<system.web.webPages.razor>
<host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<pages pageBaseType="System.Web.Mvc.WebViewPage">
<namespaces>
<add namespace="System.Web.Mvc" />
<add namespace="System.Web.Mvc.Ajax" />
<add namespace="System.Web.Mvc.Html" />
<add namespace="System.Web.Routing" />
<add namespace="CBrain.F2.SelfService.Mvc.Html" />
</namespaces>
</pages>
</system.web.webPages.razor>
<appSettings>
<add key="webpages:Enabled" value="false" />
</appSettings>
<system.web>
<compilation>
<assemblies>
<add assembly="System.Web.Mvc, Version=5.2.7.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
</assemblies>
</compilation>
</system.web>
<system.webServer>
<handlers>
<remove name="BlockViewHandler"/>
<add name="BlockViewHandler" path="*" verb="*" preCondition="integratedMode" type="System.Web.HttpNotFoundHandler" />
</handlers>
</system.webServer>
</configuration>
Turns out that IIS behaves a bit strange: once the webpage loads correctly first time, I can change the Views/web.config without IIS detecting the change. But then I modify the main web.config ... whereafter IIS detects my changes in Views/web.config. Guess I have to live with that.

httphandler in asp.net never gets called

I have a web application running in .net framework 2.0 and hosted on IIS 7.5. The app pool is running in classic mode. I want to intercept all the requests containing .txt files. Below is my entry in web.config
<system.webServer>
<validation validateIntegratedModeConfiguration="false"/>
<handlers>
<add name="NES.HiLo.Security.CommunityResource, NES.HiLo.Security" verb="*" path="*.txt" type="NES.HiLo.Security.CommunityResource, NES.HiLo.Security" />
</handlers>
</system.webServer>
<httpHandlers>
<add verb="*" path="*.txt" type="NES.HiLo.Security.CommunityResource, NES.HiLo.Security" />
</httpHandlers>
When I m making requests for URL like
http://local.mysite.com/media/CLT/ResourceUploads/1000277/Test1.txt
the handler never kicks in, the control never comes inside the code in the handler.
Any ideas what I m missing? thanks
According to the MSDN example of registering handler in IIS 7.0 in classic mode, you are missing a couple of attributes:
<system.webServer>
<validation validateIntegratedModeConfiguration="false"/>
<handlers>
<add name="CommunityResourceHandler" verb="*" path="*.txt"
type="NES.HiLo.Security.CommunityResource, NES.HiLo.Security"
modules="IsapiModule"
scriptProcessor="FrameworkPath\aspnet_isapi.dll"
resourceType="File" />
</handlers>
</system.webServer>
<httpHandlers>
<add verb="*" path="*.txt" type="NES.HiLo.Security.CommunityResource, NES.HiLo.Security" />
</httpHandlers>

asmx webservice on IIS6 gives a 404 error

I'm stuck with deploying a simple webservice to an IIS6 on a W2K3 server and hope someone can help me..
The server has Microsoft .Net Framework 3.5 SP1 installed.
The webapplication has the default 3.5 web.config
As soon as I xcopy a simple webservice (just an .asmx file without codebehind) to the server I get the following error:
Server Error in '/vd' Application.
The resource cannot be found. Description: HTTP 404. The resource you
are looking for (or one of its dependencies) could have been removed,
had its name changed, or is temporarily unavailable. Please review
the following URL and make sure that it is spelled correctly.
Requested URL: /vd/ws/EmptyService.asmx
-------------------------------------------------------------------------------- Version Information: Microsoft .NET Framework Version:2.0.50727.3053;
ASP.NET Version:2.0.50727.3053
When I copy other files (html, aspx, ..) to that folder they render just fine.
So I have a feeling it's an issue with the asmx mapping but don't know where and what to correct?
Hoping this is familiar to some of you..
<httpHandlers>
<remove verb="*" path="*.asmx"/>
<add verb="*" path="*.asmx" 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" validate="false" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
</httpHandlers>
Ah, so stupid of me..
Turned out I had a bad section in my web.config, I had been so dumb of specifying my own wsdlHelpGenerator for branding purposes and then forgot to copy that page over... It's exactly as the error said... "the resource you are looking for (or one of its dependencies) could have been removed ..."
<webServices>
<protocols>
<add name="HttpGet"/>
<add name="HttpPost"/>
</protocols>
<wsdlHelpGenerator href="GLSWsdlHelpGenerator.aspx"/>
</webServices>

Facing an error on treeview control when code is transferred from one machine to another

I am facing an error on the tree view control. Image is shown below.
What could be the potential reasons for it. I have transferred published code from one PC to another. The target machine is having windows 2008 server.
Everything is fine except the treeview control:
What could be the potential reasons for it?
Update
Here is an excerpt from my web.config
<system.webServer>
<validation ntegratedModeConfiguration="false" />
<handlers>
<add name="ReportViewerWebControl"
path="Reserved.ReportViewerWebControl.axd" verb=""
type="Microsoft.Reporting.WebForms.HttpHandler"
resourceType="Unspecified"
requireAccess="Script"
preCondition="integratedMode" />
<add name="ReportViewerWebControlHandler"
preCondition="integratedMode"
verb=""
path="Reserved.ReportViewerWebControl.axd"
type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
</handlers>
This happens when you transfer files from one server to another but miss out the mapping for axd files.
Many controls embed images inside dlls and retrive them using WebResource.axd.
A common cause is moving from one version of IIS to another.
In IIS6 you would map it as:
<httpHandlers>
<add verb=”Get” path=”WebResource.axd”
type=”System.Web.Handlers.AssemblyResourceLoader” />
</httpHandlers>
However in IIS7 you will need
<system.webServer>
<modules>
</modules>
<handlers>
<add name=”webresources” verb=”Get” path=”WebResource.axd”
type=”System.
Web.Handlers.AssemblyResourceLoader” />
</handlers>
</system.webServer>

MTOM enabled, getting "Maximum request length exceeded." still

This is getting Frustrating ... I am semi-new to web services, and I dont really understand why I can't figure out how to use Microsoft WSE 3.0 to enable MTOM encoding for SOAP on my web service. I have added the following to my web service:
Web.config and app.config in my library on the server:
<configuration>
<configSections>
<section name="microsoft.web.services3" type="Microsoft.Web.Services3.Configuration.WebServicesConfiguration, Microsoft.Web.Services3, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
</configSections>
<system.web>
<httpRuntime maxRequestLength="134217728" executionTimeout="300"/>
<webServices>
<soapExtensionImporterTypes>
<add type="Microsoft.Web.Services3.Description.WseExtensionImporter, Microsoft.Web.Services3, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
</soapExtensionImporterTypes>
<soapServerProtocolFactory type="Microsoft.Web.Services3.WseProtocolFactory, Microsoft.Web.Services3, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
</webServices>
<compilation>
<assemblies>
<add assembly="Microsoft.Web.Services3, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
</assemblies>
</compilation>
</system.web>
<microsoft.web.services3>
<messaging>
<mtom serverMode="always" />
<maxMessageLength value="134217728" />
</messaging>
</microsoft.web.services3>
</configuration>
On the client side I added the same to the app.config, adding did clientMode="On".
When I try to upload a 40MB file, I get the popular error "Maximum request length exceeded."
Any explanation? Do I have to tell the transports to use that configuration? How do I do that? Thanks!
You might be running up against the maxAllowedContentLength of the Web Server. If you are running IIS7, try adding this code block to your web.config. IIS7 filters the request before the http runtime gets it.
http://msdn.microsoft.com/en-us/library/ie/ms689462(v=vs.90).aspx
<system.webServer>
<security>
<requestFiltering>
<requestLimits maxAllowedContentLength="134217728" />
</requestFiltering>
</security>
</system.webServer>

Categories