virtualpathprovider

.NET VirtualPathProviders and Pre-Compilation

Hi, We've been working on an application that quite heavily relies on VirtualPathProviders in ASP.NET. We've just come to put the thing on a live server to demonstrate it and it appears that the VirtualPathProviders simply don't work when the site is pre-compiled!! I've been looking at the workaround which has been posted here: http:/...

Using VirtualPathProvider to load ASP.NET MVC views from DLLs

Based on this question here and using code found here I'm trying to load views that are embedded resources in a separate DLL project, and the original question's author says he has had success doing this - but I can't get it to work as it seems the MVC view engine is intercepting the request and still looking at the file system for the v...

Is it possible to create a page from a string in ASP.Net?

Hi, I can create a page from a file with: Page page = BuildManager.CreateInstanceFromVirtualPath( virtualPath, typeof(Page)) as Page; How can I instantiate a page from a stream or a string? Thank you. ...

Compiling/Embedding ASCX templated UserControls for reuse in multiple web applications

Hi, I'm onto a real head scratcher here ... and it appears to be one of the more frustrating topics of ASP.NET. I've got an assembly that implements a-lot of custom Linq stuff, which at it's core has zero web functionality. I have an additional assembly that extends this assembly with web specific behaviour. The web specific behaviou...

Web Deployment Project: Publish without Precompilation

The Question Is it possible to publish a web application project using a web deployment project without precompilation? Notes In order to split out web controls and pages into a separate assembly, I am using a custom VirtualPathProvider to load these resources. I am using web deployment projects and msbuild at cmd line to deploy thes...

Anyone ever try this: Custom VirtualPathProvider (SQL Based) with SqlCacheDependency, SQL2005 and Service Broker?

I've been toying with the VirtualPathProvider the last couple of days and have gotten to the stage where I'm serving my aspx files from a SQL database but am stuck when it come to a method of invalidating the ASP.NET cache whenever a row on my database changes. So far I've managed to get it working using the SQL2000 method of SqlCacheDe...

C# VirtualPathProvider Static-Pages

I've got a virtual path provider (VPP) that serves simple aspx pages. The problem lies when I introduce static references such as *.css, *.jpg files, etc ... I noticed my VPP is capturing these requests. I don't want this to happen. I want the normal System.Web.StaticFileHandler to handler these requests. I've added the following in my...

Virtual Path Provider disable caching?

I have a virtual path provider. Problem is its caching my files. Whenever I manually edit one of the aspx files it references the VPP doesn't pull in the new file, it continues to reuse the old file until I restart the site. I've even over-rode the GetCacheDependency() in my VirtualPathProvider class: public override CacheDependenc...

SharePoint, VirtualPathProviders and Application Restarts

Given that the only way to unload dynamically compiled assemblies (to reclaim memory) is to unload the app domain, how does SharePoint rely on VirtualPathProviders, for master pages and page layouts in particular, without bumping into this limitation? The restart can be delayed through various settings but not avoided completely when ma...

Reference problems when using VirtualPathProvider to dynamically load a view

I have the following set of classes that I used to dynamically load in a View. The code below works well when called with .RenderPartial. public class VirtFile:VirtualFile { public VirtFile(string virtualPath) : base(virtualPath) { } public override Stream Open() { string path = this.VirtualPath; S...

Running a custom VirtualPathProvider with a PreCompiled website

Hi, currently I have a custom VirtualPathProvider in a Asp.net MVC web application. This VirtualPathProvider checks the Area from the route "/{Area}/{Controller}/..." and uses the NameSpace.{Area}.Main.dll module to return the views that are contained in that assembly as Embedded Resources. This works great and I don't have to deploy a...

Reusable ASP.NET User Control Library : Virtual path provider or ascx/aspx copy ?

I have a ASP.Net web application that I want to use as a reusable user control library in other web applications. One solution for this problem is to use what Scott Guthrie has described here: http://weblogs.asp.net/scottgu/archive/2005/08/28/423888.aspx that is to copy ascx/aspx files (without their code-behind) in the web applicatio...

Custom VirtualPathProvider unable to serve URLs ending with a directory

As part of a CMS, I have created a custom VirtualPathProvider which is designed to serve a single file in place of an actual file structure. I have it set up such that if a file actually exists on the server, that file will be served. If the file does not exist, the virtual content stored for that address will be served instead. This ...

VirtualPathProvider on IIS 6 does not handle file stream caching correctly

I am working on a framework where .aspx and .master pages are embedded in an assembly, using VirtualPathProvider to route a url to a specific embedded resource. Sample url: /_framework.aspx/mypage.aspx (which uses /_framework.aspx/mymaster.master) _framework.aspx will make IIS6 route the request through ASP.NET framework everything ...

Problem with Master Page and Virtual Path Provider

I built a deployable master page into a dll and referenced it in multiple ASP.NET Web Applications using a virtual path provider. The problem I'm having is that this really confuses the source view of my aspx pages. Here is the code inside each of my aspx.cs pages which actually attatches the MasterPage to each content page, but as I sa...

Asp.net MVC VirtualPathProvider views parse error

Hi, I am working on a plugin system for Asp.net MVC 2. I have a dll containing controllers and views as embedded resources. I scan the plugin dlls for controller using StructureMap and I then can pull them out and instantiate them when requested. This works fine. I then have a VirtualPathProvider which I adapted from this post public...

ASP .NET MVC VirtualPathProvider

I am writing a VirtualPathProvider to dynamically load my MVC views, which are located in a different directory. I successfully intercept the call before MVC (in FileExists), but in my VirtualPathProvider, I get the raw, pre-routed url like: ~/Apps/Administration/Account/LogOn Personally, I know that MVC will look for ~/Apps/Adminis...

ASP.NET MVC, Custom VirtualPathProvider and IIS6

Hi, I have implemented my own VirtualPathProvider for loading 'embedded' views. This works very well when running from Visual Studio, but I get the 'The view not found' message when running on IIS6. Is there anything missing in web.config, or could there be any other problem? I have added some logging and it seems that even though I r...

asp.net Virtual Path Provider Caching

Hi, I am a bit slow on the up-take of the Virtual Path Provider class and it's use, so only now have I started to play around with it. But I have hit a problem with the GetCacheDependency method, which is supplied in some code from the MSDN Example, or the same code is provided as a working example from this site The code: public ove...

Custom VirtualPathProvider not being used in IIS6

Hi, I added the following lines to Application_Start method in global.asax: var provider = new TestVirtualPathProvider(); HostingEnvironment.RegisterVirtualPathProvider(provider); Yet the 'TestVirtualPathProvider' is never used when deploying this application in IIS6 (it does in the ASP.NET Development Server). Edit: the default pat...