issue with Telerik_Web_UI_WebResource_axd - c#

When I run my website, I get the following error message
Cannot add duplicate collection entry of type 'add' with unique key attribute 'name' set to 'Telerik_Web_UI_WebResource_axd'
Here are the contents of web.config...
<httpHandlers>
<add path="Telerik.Web.UI.WebResource.axd" type="Telerik.Web.UI.WebResource" verb="*" validate="false"/>
</httpHandlers>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"/>
<validation validateIntegratedModeConfiguration="false"/>
<handlers>
<add name="Telerik_Web_UI_WebResource_axd" verb="*" preCondition="integratedMode" path="Telerik.Web.UI.WebResource.axd" type="Telerik.Web.UI.WebResource"/>
</handlers>
</system.webServer>
If I comment out the handlers entry.. I get the following error message...
'~/Telerik.Web.UI.WebResource.axd' is missing in web.config. RadScriptManager requires a HttpHandler registration in web.config. Please, use the control Smart Tag to add the handler automatically, or see the help for more information: Controls > RadScriptManager
I am total at loss on how to fix this. I do not know how to use Smart Tag. I have googled, looked into SO, looked into Telerik site and can not find solution any where. I do not know if the problem is in my web.config, Virtual directory or where??? My colleagues have the same code base and web.config and it works for them.
EDIT
Here is my development machine setup...
Windows 7 Enterprise Service Pack 1 64 bit OS
Visual Studio 2010 Enterprise Service pack 1 IIS version 7.5
Please help.

The problem wont be in the IIS config; as the error message specifically refers to a Web.config file, so that's going to be in .Net
What happens if you comment out the httpHandlers entry rather then handlers ?
Edit: After looking at your web.config file, the only thing I can suggest is changing the format of the system.webServer.handlers.add part from
<add name="Telerik_Web_UI_WebResource_axd" verb="*" preCondition="integratedMode" path="Telerik.Web.UI.WebResource.axd" type="Telerik.Web.UI.WebResource"/>
to:
<add name="Telerik.Web.UI.WebResource" path="Telerik.Web.UI.WebResource.axd" verb="*" type="Telerik.Web.UI.WebResource, Telerik.Web.UI" />
And that's because that's what Telerik suggest to be the best practice; If that doesn't work then I'm sorry but I'm out of ideas tonight, but please leave the question open, perhaps someone with a better idea will see it in the morning.

Related

config file flagging as duplicate Exceptionless package

Not sure what happened my project but when I tried to run it I got the error message Could not load file or assembly 'Exceptionless.Mvc' or one of its dependencies
Eceptionless.MVC is not used or referenced anywhere in my project I cant even find any text with Exceptionless......
So I used Nuget Manager to install the exceptionless.MVC package.
Now I get the error
`HTTP Error 500.19 - Internal Server Error
The requested page cannot be accessed because the related configuration data for the page is invalid.
Config Error
There is a duplicate 'exceptionless' section defined `
The install of exceptionless.Mvc added the following to my web config
<section name="exceptionless" type="Exceptionless.ExceptionlessSection, Exceptionless" />
<exceptionless apiKey="API_KEY_HERE" />
<modules runAllManagedModulesForAllRequests="true">
<add name="ExceptionlessModule" type="Exceptionless.Mvc.ExceptionlessModule, Exceptionless.Mvc" />
</modules>
and the packages config was updated
<package id="Exceptionless" version="4.2.1982" targetFramework="net45" />
That is the only ref to exceptionsless/exceptionlessMVC in my project.
I am at a loss to what its look for with mvc exceptionless or where the duplicate sections are??
any help pls?
Issue was to do with a duplicate web config file stored in the IIS. Renaming that web config allowed the original to take priority removing any duplicate issues with exceptionless.
You should try removing the handler then adding it back in. Here is a similar example:
<system.webServer>
<handlers>
<remove name="ExtensionlessUrlHandler-Integrated-4.0" />
<add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="*" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" />
</handlers>
You may need to comment out this part too.
<section name="exceptionless"....
Web.config is inheriting from Web.config from parent application. Also there is machine-wide web.config and machine.config.
1) If you application is on IIS and there is a parent application, check web.config of parent application
2) Check your machine-wide web.config and machine.config.
Assuming you're on .NET 4.0 and higher they're here:
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config
(for x32 bit application pool)
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Config
(for x64 bit application pool)

An ASP.NET setting has been detected that does not apply in Integrated managed pipeline mode.(the project does not even run locally)

This same question was posted in the site and the suggested answer was to use.
<configuration>
<system.webServer>
<validation validateIntegratedModeConfiguration="false" />
</system.webServer>
</configuration>
but adding the above mentioned line does not solve the issue.
Most likely cause
This application defines configuration in the system.web/httpHandlers
section.
And
Module ConfigurationValidationModule
Notification BeginRequest
Handler ExtensionlessUrlHandler-Integrated-4.0
Error Code 0x80070032
moreover my project does not seem to load locally as well, where as the question i mentioned earlier worked fine locally.
How do i Solve this error?
Thank you in advance. :)
Removing the following line from the web.config file fixed the issue for me.
<system.web>
<httpHandlers>
<add path="*.less" verb="GET" type="dotless.Core.LessCssHttpHandler, dotless.Core" />
</httpHandlers>
</system.web>

From where can I get the Mini-Profiler-Resource folder needed by MiniProfiler?

I'm trying to use miniProfiler in my MVC 4 project. But after installing both, miniProfiler and miniProfiler.Mvc4 and trying to run my project, MiniProfiler is not loading. In the console log show that it is trying to get a file from a folder named "mini-profiler-resource" but I dont have nothing named that in my project.
Am I missing to install something?
It is not an actual folder - rather it is a route that should be set up in MVC for you to access the resources.
Try adding the following to your web.config (per miniprofiler.com)
<system.webServer>
...
<handlers>
<add name="MiniProfiler" path="mini-profiler-resources/*" verb="*" type="System.Web.Routing.UrlRoutingModule" resourceType="Unspecified" preCondition="integratedMode" />
</handlers>
</system.webServer>

Installed glimpse attempting to access glimpse.axd and receive 404 error?

It is a simple as that I installed glimpse following this page. :
http://getglimpse.com/About/QuickStart
I then attempt to navigate to http://myApp/glimpse.axd and receive 404 error not found.
As you can see in the Quickstart there is this statement. :
If you get a "Page not found" when browsing to "/glimpse.axd" check the troubleshooting section in the FAQ.
There is nothing in the FAQ regarding this. I have skimmed this website and getGlimpse.com attempting numerous other configurations and nothing is working. Any one else run into this issue and fix it?
Tried this also. :
Glimpse for MVC3 module not found after NuGet install of Glimpse.MVC3
I encountered the same problem and in my case the solution was to add the following code to Application_Start() in the MvcApplication class:
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
Make sure you have the Glimpse module and handler registered in your web.config based on the web server you are using.
If you are using a site on IIS6, in IIS7.x classic pipeline mode or Visual Studio Development Server
<system.web>
<httpModules>
<add
name="Glimpse"
type="Glimpse.Core.Module, Glimpse.Core"
/>
</httpModules>
<httpHandlers>
<add
path="glimpse.axd"
verb="GET,POST"
type="Glimpse.Core.Handler, Glimpse.Core"
/>
</httpHandlers>
...
And if you are using IIS 7.x in integrated pipeline mode or IIS Express:
<system.webServer>
<modules>
<add
name="Glimpse"
type="Glimpse.Core.Module, Glimpse.Core"
preCondition="integratedMode"
/>
</modules>
<handlers>
<add
name="Glimpse"
path="glimpse.axd"
verb="GET,POST"
type="Glimpse.Core.Handler, Glimpse.Core"
preCondition="integratedMode"
/>
</handlers>
...
</system.webServer>
I had a multi-project solution and was installing it from the Package Manager Console. I found that installing it using the following command worked:
PM> Install-Package -ProjectName <MyProject> Glimpse.MVC4
Of course you need to replace <MyProject> with your own project name.
I have had a very similar problem, and none of these options helped me, but I did get it working. This is what I had to do:
I am using MVC 5, so make sure you have read the latest config for glimpse for the version you are using. I should have been using Glimpse.AspNet and not Glimpse.Core
My web config looks like this:
<handlers>
....
<remove name="Glimpse" />
<add name="Glimpse" path="glimpse.axd" verb="GET"
type="Glimpse.AspNet.HttpHandler, Glimpse.AspNet"
preCondition="integratedMode" />
</handlers>
<modules>
....
<remove name="Glimpse" />
<add name="Glimpse"
type="Glimpse.AspNet.HttpModule, Glimpse.AspNet"
preCondition="integratedMode"/>
</modules>
I am using IIS Express, Vs2015 and for some reason my C:\Users\me\Documents\IISExpress\config\applicationhost.config got messed up, and had a special entry for Glimpse.
So I found and removed any entries with Glimpse in them (carefully, you might want to comment them out instead)
<application path="/Glimpse.axd" applicationPool="Clr4IntegratedAppPool">
<virtualDirectory path="/" physicalPath="\path\to\extra\website" />
</application>
I think this may have happened from a really early version of glimpse been installed, and also something to do with the upgrade to MVC5, but not 100% sure why...
Hope this helps someone else.
In my case, the web app is not deployed in root, so the url is:
http://localhost:54026/MyApp/glimpse.axd
Very obvious, but I'll leave this answer as a reminder.
Install Glimpse.AspNet and it will fix the issue for you and also modify the web.config by adding the handler and module.

HttpHandler Redirect

I want to write an HttpHandler to redirect traffic to various webpages on the server.
The user will type in http://www.thisissupposedtoberedirected.com/site12 and should be redirected to the appropiate site, in this example site version 1.2
I know how to program in ASP.NET and C# but I don't seem to grab the finer detail about website management.
How can I manage to get this done? What should I do in the web.config? I've read this msdn page but it isn't much help.
HttpHandlers are actually fairly simple components.
First, you need to create a class that inherits either IHttpHandler or IHttpAsyncHandler (for your use, I'd suggest IHttpHandler since there's really no heavy lifting being done).
You then compile the DLL and drop it in the bin folder of your web application.
Now the tricky part. Deploying HttpHandlers in the web.config file is tricky since it's different between IIS6, IIS7 Integrated Mode, and IIS7 Classic Mode. The best place to look is this MSDN page:
How to: Register HTTP Handlers
IIS6
<configuration>
<system.web>
<httpHandlers>
<add verb="*" path="SampleHandler.new"
type="SampleHandler, SampleHandlerAssembly" />
</httpHandlers>
<system.web>
</configuration>
IIS7 Classic Mode
<configuration>
<system.web>
<httpHandlers>
<add verb="*" path="SampleHandler.new"
type="SampleHandler, SampleHandlerAssembly" />
</httpHandlers>
<system.web>
<system.webServer>
<add name=SampleHandler" verb="*" path="SampleHandler.new"
Modules="IsapiModule"
scriptProcessor="FrameworkPath\aspnet_isapi.dll"
resourceType="File" />
</system.webServer>
</configuration>
IIS7 Integrated Mode
<configuration>
<system.webServer>
<handlers>
<add name="SampleHandler" verb="*"
path="SampleHandler.new"
type="SampleHandler, SampleHandlerAssembly"
resourceType="Unspecified" />
</handlers>
<system.webServer>
</configuration>
As you can see, each IIS configuration requires entries in slightly different sections of the web.config file. My suggestion would be to add entries in each location so that IIS configuration changes don't break your HttpHandler.
1) You need to create a new class that implements IHttpHandler or IHttpAsyncHandler (the latter being when you are very comfortable with managing your own threads). Create your logic there.
2) Then, modify the web.config so that you register your handler:
<system.web>
<httpHandlers>
<add verb="*" path="*.htm" type="System.Web.StaticFileHandler"/>
<add verb="*" path="*.html" type="System.Web.StaticFileHandler"/>
<add verb="*" path="*.ico" type="System.Web.StaticFileHandler"/>
</httpHandlers>
</system.web>
This is a sample setup in my web.config - yours may vary slightly.
Now, your HttpHandler should be registered and based on the details provided in your registration in the web.config, when you request certain URLs, you will be mapped to the Handler you created instead of the normal ASP.NET Page Handler.
Additionally, for your specific issue, I wouldn't recommend writing a HttpHandler - I would just do a DNS redirect, or do some lookup in your OnInit code to check the Host Url, and if it is one specified in your DB, you do the redirect yourself based on the configuration data.

Categories

Resources