The new WebResource handler

Note: this entry has moved.

No one was talking about this new ASP.NET 2.0 feature until Jesse posted this today (actually yesterday) and then Nikhil replied back.

Having spent some time looking at the internals of the AssemblyResourceLoader type (the type that implements WebResource’s functionality) the reason why I haven’t posted about it before is because I’m waiting for my article (title is *not* final) “Handling client files in ASP.NET Whidbey” (where I detail WebResource internals and develop a custom control that uses it) to show up at MSDN, but now that the ball has started rolling I just can’t remain in silence :-)

While I don’t fully agree with Jesse about the actual problems of using WebResourceAttribute I do have my own concerns, the main one based on the fact that a malicious user can fake a WebResource URL and cause any well-known GAC assembly to be loaded up by your application; not really nice ugh?. I’m confident the current security scheme will suffer some changes down the road.

Also, if you are intrigued (and I’m sure you are) about the example given at the end of Nikhil’s post and you’re trying to make it work using the PDC bits you may stop smashing your head against the monitor :-) Because of a minor bug (detailed in my article) in the implementation of this substitution feature you need to make sure the size of the embedded resource help.htm is larger than 1024 bytes by filling it with blank spaces or your favorite dummy character.

In short, I definitively believe this is a really cool feature that will greatly simplify deployment of client files.

3 Comments

  • That is a good point... you could probably max out a machine's resources pretty quickly by causing each site on the server to load up every well known assembly you could think of... since they can't be unloaded w/o unloading the entire APP domain, this could really suck.

  • Just a quick note...



    The bug with the substitution feature has been fixed in the post-PDC builds. That explained why I didn't see it...

  • Totally agree with you . I was just thinking about it the other day......how are they gonna work so fast to port .net to linux if asp.net 2.0 is already coming out soon.



    And i dont think people will be ok with coding in 1.1 if 2.0 is out already...just to use linux. anyways. hope they can port it fast...since its good. we'd get a lot of switches.

Comments have been disabled for this content.