views:

22

answers:

2

By ASP.NET MVC plugin architecture, http://stackoverflow.com/questions/340183/plug-in-architecture-for-asp-net-mvc

I have separated DLL(plugin) which contains the views, css and javascript files in the resources. So my own VirtualPathProvider will load the content out from the DLL if that is for the plugin. It works all fine during development. But It appears not working once I deployed it in IIS. (I mapped the whidcard in IIS 6 and the views are showing)

I have registered my VirtualPathProvider in global.asax as

protected void Application_Start()
{
    RegisterRoutes(RouteTable.Routes);
    HostingEnvironment.RegisterVirtualPathProvider(new MyVirtualPathProvider());
}

For example. http://localhost/Plugin/MyPlugin.dll/Styles.MyStyles.css

This should be loaded from the plugin.dll but IIS returns 404.

I guess the static files are all handled by the IIS and not went through asp.net and my VirtualPathProvider ? Is there way to get around this? Please shed some light.

Thanks in advance.

+2  A: 

If this is IIS 6 you will need a wildcard mapping. See this blog post from Phil Haack.

Darin Dimitrov
I have done the wildcard mapping in IIS 6 as I mentioned in the post.
codemeit
Thanks, but still doesn't work for the url like http://localhost/Plugin/MyPlugin.dll/Styles.MyStyles.cssI placed logging with my MyVirtualPathProvider, it wasn't even running by the url above. everything works fine within Visual studio web development server though, any clue?
codemeit
A: 

I've found the workaround by adding the staticFileHandler in the web.config httpHandlers element.

<add verb="GET,HEAD,POST" path="*" type="System.Web.StaticFileHandler" validate="true" />
codemeit