2

I have an asp.net 4.0 webforms website with a CSS stylesheet which I've embedded into a separate assembly.

If I load the css using ClientScript.GetWebResourceUrl it loads, but does it with that /WebResource.axd?whateverlongstringofstuff

I was hoping that I could use a Virtual Path provider so that i can simply reference it by linking to say ~/Custom/my.css

where ~/Custom/* would go through the VPP and serve it from the embedded resource.

the reason I was doing this is I want users to be able to easily override my css by adding the actual css file in that location so it serves that one instead.

However, no matter what I try, I get a 404 on that resource url, even though in my custom ResourceResolver, the fileExists resolves to true (because it does find it in the resources assembly).

So I suspect this is because IIS is configured to serve static files (css, jpg, png, etc) directly, bypassing anything I could add to the pipeline, and the only way around this would be to have my users change their web.config or IIS settings.

Is this true? because if it is I'll abandon this and go back to the WebResource.axd, but it would really be nice if this could be done

SelAromDotNet
  • 4,715
  • 5
  • 37
  • 59
  • Were you able to solve this? I've a simliar issue described here: http://stackoverflow.com/questions/34787206/asp-net-using-embedded-resources-in-bundling – Pascal Berger Jan 18 '16 at 07:52
  • 1
    sorry if I did figure this out I sure don't remember how I did it :( i'll dig through some old projects and see if anything jogs my memory! – SelAromDotNet Jan 18 '16 at 21:27

0 Answers0