404 - The resource cannot be found - on IIS w/ Images

May 12, 2011 at 6:28 AM

It looks like the following line of code was added to RegisterRoutes (possibly with the addition of SquishIt):

routes.RouteExistingFiles = false;

Unfortunately, it looks like this blocks access to all image files (and other static files).  This works fine with the default Theme because it doesn't use any images, but if you switch over to Emplode, a few additional images won't load (there's already a few that don't load because the path needs to be updated).

Just curious why it was added.  Is it safe to remove it?

Thanks!

May 19, 2011 at 7:35 PM

CORRECTION - it turns out that the real issue was that there is a web.config in the ~/Resources directory (never would have guessed).  This web.config contained:

<handlers>
  <remove name="BlockViewHandler"/>
  <add name="BlockViewHandler" path="*" verb="*" preCondition="integratedMode" type="System.Web.HttpNotFoundHandler" />
</handlers>

...and that was causing a "404 - The resource cannot be found" error to be returned any time an image was requested from the Resouces directory - including those in ~/Resources/Themes/Emplode/Images.  A couple things made it more confusing- primarily the fact that the problem only occurs when using "IIS" - it did NOT occur using "IIS Express". 

Guess I'm pretty dumb...wasted a lot of time on this issue.

May 25, 2011 at 5:35 PM

I had the same exact experience as you in resolving this issue.  It appears that the Emplode theme still needs a bit of work as all of the Category and Gallery links are hard-coded rather than config-driven.  If I get some time I'll try to make the necessary data structures and a couple of partial views to support the configuration of these values.

Coordinator
May 26, 2011 at 12:31 PM

Yes, there seem to be a few issues with Emplode caused by some refactoring, where I updated the default theme but missing a few things in Emplode.  Will get this fixed up for the next release.