Aaron
Aaron

Reputation: 61

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.

Upvotes: 6

Views: 4374

Answers (6)

Dr Alex
Dr Alex

Reputation: 21

For some reason the only way we could fix showing css in debug=false mode is by adding combres.axd to the anonymous access in web.config

  <location path="combres.axd">
    <system.web>
      <authorization>
        <allow users="*" />
      </authorization>
    </system.web>
  </location>

Upvotes: 1

Wahid Bitar
Wahid Bitar

Reputation: 14094

This happened to me too but the problem was from Yahoo.Yui.Compressor they changed one property signature in their new version 1.6*.

So to fix it i just down the Yahoo.Yui.Compressor to version 1.5.

And i'm happy now :)

Upvotes: 0

Mangesh
Mangesh

Reputation: 3997

These are the changes i did in the project and it stated to run properly.

In the Global.asax file add these lines

using Combres;

In the application_start method

protected void Application_Start()
{
    RouteTable.Routes.AddCombresRoute("Combres");//Add this line
    RegisterRoutes(RouteTable.Routes);
} 

Comment out the line in Combres.cs file.

Upvotes: 0

RyanW
RyanW

Reputation: 5398

What is your modules setting in web.config? Check for the runAllManagedModulesForAllRequests attribute.

<system.webServer>
    <modules runAllManagedModulesForAllRequests="true"/>
</system.webServer>

With a legacy WebForms app, I found I did not have that setting and once I put it in, the combres.axd route worked.

More on my question too

Upvotes: 0

JCallico
JCallico

Reputation: 1457

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");

Upvotes: 6

samy
samy

Reputation: 14962

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

Upvotes: 1

Related Questions