System.Web 2.0.0.0 System.MarshalByRefObject The class provides a set of methods for implementing a virtual file system for a Web application. In a virtual file system, the files and directories are managed by a data store other than the file system provided by the server's operating system. For example, you can use a virtual file system to store content in a SQL Server database. You can store any file that is processed on request in a virtual file system. This includes: ASP.NET pages, master pages, user controls, and other objects. Standard Web pages with extensions such as .htm and .jpg. Any custom extension mapped to a instance. Any named theme in the App_Theme folder. You cannot store ASP.NET application folders or files that generate application-level assemblies in a virtual file system. This includes: The Global.asax file. Web.config files. Site map data files used by the . Directories that contain application assemblies or that generate application assemblies: Bin, App_Code, App_GlobalResources, any App_LocalResources. The application data folder, App_Data. If a Web site is precompiled for deployment, content provided by a instance is not compiled, and no instances are used by the precompiled site.

Registering a VirtualPathProvider

A custom instance should be registered with the ASP.NET compilation system by using the method before any page parsing or compilation is performed by the Web application. Typically, a instance is registered in an AppInitialize method defined in the App_Code directory, or during the Application_Start event in the Global.asax file. For an example of registering a instance in an AppInitialize method, see the Example section. You can register a instance during other events, but pages compiled and cached before the instance is registered will not be invalidated, even if the new instance would now provide the source for the previously compiled page.
Provides a set of methods that enable a Web application to retrieve resources from a virtual file system.
Constructor When overriding the constructor, defer any initialization that must occur after the object is registered to the method. Initializes the class for use by an inherited class instance. This constructor can be called only by an inherited class. 2.0.0.0 Method System.String Use the method to inspect the contents of a relative path to a virtual resource and perform any modifications required. The default implementation combines the and parameters according to standard ASP.NET path processing. Combines a base path with a relative path to return a complete path to a virtual resource. The complete path to a virtual resource. The base path for the application. The path to the virtual resource, relative to the base path. 2.0.0.0 Method System.Boolean Override the method to indicate to the compilation system that the resource represented by exists in the virtual file system provided by this instance. If your custom class does not support directories, the method should return false. If your virtual file system will contain themes for the Web site (by creating a virtual App_Themes directory), your custom class must support directories. Gets a value that indicates whether a directory exists in the virtual file system. true if the directory exists in the virtual file system; otherwise, false. The path to the virtual directory. 2.0.0.0 Method System.Boolean Override the method to indicate to the compilation system that the resource represented by exists in the virtual file system provided by this instance. Gets a value that indicates whether a file exists in the virtual file system. true if the file exists in the virtual file system; otherwise, false. The path to the virtual file. 2.0.0.0 Method System.Web.Caching.CacheDependency The default implementation of the method returns null. To cache virtual resources for later use you must override either the method or the method. Creates a cache dependency based on the specified virtual paths. A object for the specified virtual resources. The path to the primary virtual resource. An array of paths to other resources required by the primary virtual resource. The UTC time at which the virtual resources were read. 2.0.0.0 Method System.String Use the method to provide a custom cache key for virtual resources. If you do not override the method, the virtual path is used for the cache key. Returns a cache key to use for the specified virtual path. A cache key for the specified virtual resource. The path to the virtual resource. 2.0.0.0 Method System.Web.Hosting.VirtualDirectory The method returns a descendent of the class that contains the file and directories contained in the directory specified in the parameter. If your custom class does not support directories, the method should return null. If your virtual file system will contain themes for the Web site (by creating a virtual App_Themes directory), your custom class must support directories. Gets a virtual directory from the virtual file system. A descendent of the class that represents a directory in the virtual file system. The path to the virtual directory. 2.0.0.0 Method System.Web.Hosting.VirtualFile The method returns a descendent of the class that represents the file specified by the parameter. Gets a virtual file from the virtual file system. A descendent of the class that represents a file in the virtual file system. The path to the virtual file. 2.0.0.0 Method System.String Use the method to provide a hash of the dependencies for a virtual-file-system resource. Returns a hash of the specified virtual paths. A hash of the specified virtual paths. The path to the primary virtual resource. An array of paths to other virtual resources required by the primary virtual resource. 2.0.0.0 Method System.Void The method is called after the provider is registered with the ASP.NET compilation system. The method is used to provide any initialization required after the instance is placed into the environment the application occupies. Initializes the instance. 2.0.0.0 Method System.Object This method overrides the method in its base class. It always returns null and thereby prevents a lease from being created that would limit the object's lifetime. Gives the object an infinite lifetime by preventing a lease from being created. Always null. 2.0.0.0 Method System.IO.Stream The method is a convenience method that enables you to get a stream from a virtual file without creating a instance. Returns a stream from a virtual file. A read-only object for the specified virtual file or resource. The path to the virtual file. 2.0.0.0 Property 2.0.0.0 System.Web.Hosting.VirtualPathProvider To be added. When a object is registered with the ASP.NET compilation system, it is added to a chain of providers. Use the property to hand processing off to the previous object in the chain if the requested path is not provided by this instance. The chain of path providers always ends with the default ASP.NET provider, which serves files from the file system. Gets a reference to a previously registered object in the compilation system.