VirtualPathProvider not working for static files under IIS 6

By admin - Last updated: Wednesday, June 30, 2010 - Save & Share - Leave a Comment

If  you have come across embedding the css, javascript and aspx into a separate dll as resources and the website will resolve them by read out from resources by using the custom VirtualPathProvider. One of the ASP.NET plugin architectures used this method and it works quite well.

During the development with visual studio built-in development server, everything works perfectly.
Once I deployed to IIS6, it turns out all the css and javascript files embedded in the dll can not be resolved.
They are things you may need to check.

HostingEnvironment.RegisterVirtualPathProvider(new MyVirtualPathProvider());
<add verb=“GET,HEAD,POST” path=“*” type=“System.Web.StaticFileHandler” validate=“true” />

It fixed my problem. and now http://example.com/Plugin/MyPlugin.dll/Style.css should be handled by your MyVirtualPathProvider if the path was expected by it.




Posted in NotWorking • Tags: , Top Of Page

Write a comment


Captcha: 6 − five =