Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Combres' route (combres.axd) doesn't work

I have followed the article http://www.codeproject.com/KB/aspnet/combres2.aspx.

When I run my site I cannot get the combres.axd to work ? I know that the combres is running since an incorrect file in my xml will cause an error. I am running an ASP.NET 4.0 web forms site on vista.

My Combres XML settings are.

resourceSets url="~/combres.axd" defaultDuration="30" defaultVersion="auto" defaultDebugEnabled="auto"

I have checked the web.config for all correct values. The reference has been added from the merge directory and the global ASX file has the following.

protected void Application_Start(object sender, EventArgs e)
        {
            RouteTable.Routes.AddCombresRoute("Combres");
        }

I also checked the value is created in the html source.

href="/combres.axd/siteCss/309885723"

  src="/combres.axd/siteJs/408582048"

I do not get an error or anything to help me track down the reason it will not work or what I may have missed. Any suggestions would be great.

like image 630
Aaron Avatar asked Jun 30 '10 14:06

Aaron


2 Answers

I had the same problem when trying to get it to work for the first time.

Make sure that the Combres route is added before the call to ignore the route {resource}.axd.

Correct:

RouteTable.Routes.AddCombresRoute("Combres");
RouteTable.Routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

Incorrect:

RouteTable.Routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
RouteTable.Routes.AddCombresRoute("Combres");
like image 146
JCallico Avatar answered Nov 25 '22 10:11

JCallico


First, i'd suggest to hook a log4net to the combres logger in your web.config (don't forget to setup the configsection for log4net)

<log4net>
<logger name="Combres">
  <level value="ALL"/>
  <appender-ref ref="LogCombres" />
</logger>

<appender name="LogCombres" type="log4net.Appender.RollingFileAppender">
  <file value="Combres.log.txt"/>
  <appendToFile value="true"/>
  <maximumFileSize value="5000KB"/>
  <maxSizeRollBackups value="2"/>
  <layout type="log4net.Layout.PatternLayout">
    <conversionPattern value="%d [%t] %-5p %c - %m%n"/>
  </layout>
</appender>
</log4net>

And in your global.asax launch the configuration

log4net.Config.XmlConfigurator.Configure()

You should have a detailed log of what's happening. If what's wrong doesn't pop out, don't hesitate to come back with some log output

like image 42
samy Avatar answered Nov 25 '22 09:11

samy