Single assembly plugin - fails to load embedded resources in IIS

I have a problem with an EPiServer plugin that Im currently working on. The plugin is a single assembly plugin, meaning that all files are embedded as resources and delivered in a single .dll. When the plugin is loaded in the dev server in Visual Studio everythings works fine. When loaded in a website in the local IIS, .aspx and .ascx are loaded, but not other static files as .js or .css. I get a file not found error. Ive used reflector on the plugin dll and all resources are included correctly.

Hi Ben,Thanks for takeing some time to answer this one. The first blog post that you've included is the one that is the base for my solution. I have a virtual path provider that works fine with all files when runned from Visual Studio dev server. If i put the same plugin in an IIS website it only works with user controls and pages but not with other static content like js or css.

Are you using the GetWebResourceUrl method to get the embedded resource URLs? It worked for me when referring to embedded static image resources. You have to get the namespace arguments right, but if you want to access an image called test_image.gif on a page called MyActionWindow in as assembly called MyPlugins the code would look something like:

This is off-topic, but single assembly plugins can be a pain to troubleshoot if you're having trouble making them work on your site (let alone the pain of creating them). I've personally given up on a few of these modules as I was not able to make them work in my environment.

Yes; I know, done correctly it should just work. It has not always done so for me, so I won't use single assembly modules unless I get the source code too (and even then I hesitate.)

The problem with "static" resources not loading, like *.js, *.gif et.c., is most likely the <location> from where the resources are delivered dont specify the EPiServer.Web.StaticFileHandler but the standard System.Web.StaticFileHandler.

You can either add the required <location>-settings for your path, or simply make use of one of the paths already setup like this in EPiServer, for example the /utils location. A simple approach would be to register (and reference) your ressources with a path like /util/MyStuff/MyFile.js