Virtual Happy Hour this month, Jun 28, we'll be getting a sneak preview at our soon to launch SaaS CMS!

Try our conversational search powered by Generative AI!

Single assembly plugin - fails to load embedded resources in IIS


Hello EPI developers,

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.

What can be the cause of this problem? Any thoughts?
// Jonas

Feb 23, 2010 11:46

A commonly-used solution is to create a Virtual Path Provider to serve up the embedded resources and ship it with your DLL.

There are some good posts knocking around about this to get you started - it worked for me, by the way.

Dan Matthews wrote about it first (I think) here:

Johan Olofsson wrote a similar piece with a nice enhancement here:


Feb 23, 2010 12:21

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.

// Jonas

Feb 23, 2010 12:40

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:

string url = Page.ClientScript.GetWebResourceUrl(typeof(MyActionWindow), "MyPlugins.test_image.gif");

(NB: This assumes that all the files are sitting in the root directory of the project)

I hate to admit this, but the JS and CSS on my action window was embedded into the HTML [hangs head in shame...]

Would also take care with the Url argument that you use on the class's GuiPlugIn attribute - this caused me grief too...

DisplayName = "Action window plugin",
Area = PlugInArea.ActionWindow,
Url = "~/App_Resource/MyPlugins.dll/MyPlugins.MyActionWindow.ascx"

Hope this helps in some way and sorry if I'm stating the obvious - good luck finding your CSS and JavaScript files...


Feb 23, 2010 13:05

Jonas, if you (or anyone else for that matter) knows a way to fix this problem, could you please send me a mail at


Dec 14, 2010 17:36

Allan Thraen has a good post for easier  single assembly plugins. I've used it to load .js content in a single assembly custom property.

Dec 15, 2010 8:27

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.)


Dec 15, 2010 9:10

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


Dec 15, 2010 10:10
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.