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.
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");
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With