System.Web.Routing.UrlRoutingModule does not implement IHttpHandlerFactory or IHttpHandler Error

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
8 лет назад
I keep getting the above error with the following detail. it looks as though its related to my robots.txt file.

System.Configuration.ConfigurationErrorsException: System.Web.Routing.UrlRoutingModule does not implement IHttpHandlerFactory or IHttpHandler. at System.Web.Configuration.HandlerFactoryCache.GetHandlerType(String type) at System.Web.Configuration.HandlerFactoryCache..ctor(String type) at System.Web.HttpApplication.GetFactory(String type) at System.Web.HttpApplication.MaterializeHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

Page Url:    http://www.activeleisurecontracts.co.uk/robots.txt

Any ideas.

cheers,

Anthony
8 лет назад
Any ideas anyone?
8 лет назад
same with me
shame, no-one has given an answer, yet
8 лет назад
nopCommerce generates a robots.txt automatically. When you try to add a physical robots.txt file the MVC routing will get messed up and you will get this error.

To change the autogenerated content served when calling robots.txt you can modify the RobotsTextFile Action in CommonController.

Another way to do this, if you don't want to touch the core, is to write an ActionFilterAttribute that catches all calls made to this particular Action and serve any content you like.
We use this aproach to serve a "dissalow all"-robots.txt on our development sites.
8 лет назад
Remove (or comment out) this line from your web.config For generating robot.txt

      <add name="RobotsTxt" path="robots.txt" verb="*" type="System.Web.Routing.UrlRoutingModule" resourceType="Unspecified" preCondition="integratedMode" />
8 лет назад
anik1991 wrote:
Remove (or comment out) this line from your web.config For generating robot.txt

      <add name="RobotsTxt" path="robots.txt" verb="*" type="System.Web.Routing.UrlRoutingModule" resourceType="Unspecified" preCondition="integratedMode" />


Ah yes, look at that. This would definitely be the best solution.
8 лет назад
Thanks, I resolved this issue by commenting out the web.config two lines of code as above.

So now you can access: https://www.yesbobbleheads.com/robots.txt file now.
7 лет назад
Great answer! Solved my issue! Thanks!
7 лет назад
I was trying to testing my sitemap & robots file www.mydomain.com/sitemap.xml and www.mydomain.com/robots.txt I was getting same error System.Web.Routing.UrlRoutingModule does not implement IHttpHandlerFactory or IHttpHandler, me just removed below two lines from web.config and it worked fine for me:

<add name="SitemapXml" path="sitemap.xml" verb="*" type="System.Web.Routing.UrlRoutingModule" resourceType="Unspecified" preCondition="integratedMode" />
      <add name="RobotsTxt" path="robots.txt" verb="*" type="System.Web.Routing.UrlRoutingModule" resourceType="Unspecified" preCondition="integratedMode" />
7 лет назад
Another way to uncomment the following lines in web.config

<remove name="UrlRoutingModule-4.0" />
<add name="UrlRoutingModule-4.0" type="System.Web.Routing.UrlRoutingModule" preCondition="" />
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.