[RESOLVED] Embedding Files in an assembly

I have an embedded file in an assembly.  It looks something like this:

<Assembly: WebResource("File.css", "text/css", PerformSubstitution:=True)>

And is called like this:

Page.ClientScript.GetWebResourceUrl(Me.GetType(), "File.css")

Everything works just fine, except for every once in a while, I get a slew of http file not found errors when the browser trys to access the resource WebResource.axd?d={0}.  (where {0} is some long encoded identifier).

Is there a way to give each resource a consistant identifier or name?


Are you getting these errors in the browser or just in the log files? If you see them in your log files it is usually because someone is using a cached page and then the autogenerated id is out of date, and the resource can not be found.


Log Files...That makes perfect sense after reading: http://www.eggheadcafe.com/tutorials/aspnet/2d46e075-3cdf-44d5-b2b6-f27c1f3beb34/using-the-webresourceaxd-handler-with-embedded-aspnet-resources.aspx.

So if I let a build sit for a few days, the frequency of these events should decrease?


You will probably see them quite often since pages are cached at a lot of places, for example if your pages are indexed by any search engine like Google they will often try to access them by using a cached page first. I saw this error often in my logs when pages where accessed by IPs from search engines.


thoughts on "[RESOLVED] Embedding Files in an assembly"

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>