Question

This issue has me quite confused and, I hope someone can see the rhyme or reason as to the cause. Only some of my images are not accessible via the browser and, the cause doesn't seem to be any of the typical suspects. When I attempt to access some of the images I get a server 500.0 error.

Example;

  • /Content/jQuery/Plugins/DataTables/images/sort_asc.png [Works]
  • /Content/jQuery/Plugins/DataTables/images/sort_both.png [Doesn't]

Now before you say check the file permissions, I've done that. All properties & permissions are the same. Not only that but if I rename sort_both.png to be sort_both.png it still isn't accessible. I even have *routes.IgnoreRoute("Content/{pathInfo}"); in my register routes. I even moved sort_both.png to the root of my content folder /Content/sort_both.png and I still cannot reach it in my browser.

Anyone have some suggestions on how to triage this next?

Was it helpful?

Solution

Ok.. So I figured out the cause for this because I wanted to be able to do pathing as such; "api/{controller}/{action}.{ext}" so that I could use my media type formatter to use the same class and either return the data as json or in an xlsx (Excel) file.

I did some researching (although not enough I suppose) and the solution that appeared to work was updating my web config from;

<add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="*" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" />

to

<add name="ExtensionlessUrlHandler-Integrated-4.0" path="*" verb="*" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" />

Note the change in the path from *. to * which did allow me the pathing I desired. I at least didn't notice the missing images after I got this in place, or some were just cached.

Welp, I'm not sure why some files would work and others would not but, it did break "something". So I've opted to just K.I.S.S. and just go with the format "api/{controller}/{ext}/{action}"

Sorry for the posting but, hopefully someone else who follows the chain of events I went through can learn from my mistake.

This question is closed and the reason (IMHO) is PEBCAK.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top