Create your custom virtual path provider class, overriding the method you want, and then call HostingEnvironment.RegisterVirtualPathProvider
from within Application_Start
(defined in global.asax.cs
) to install it:
protected void Application_Start() {
HostingEnvirontment.RegisterVirtualPathProvider(new MyVPProvider());
}