virtualpathprovider

ASP.NET using embedded resources in Bundling

混江龙づ霸主 提交于 2019-12-13 12:59:02
问题 I'm trying to implement a generic approach for providing the possibility for different assemblies in my web solution to use embedded JavaScript and CSS files from embedded resources. This blog post shows a technique using a VirtualPathProvider. This works fine, but the VirtualPathProvider needs to be included in each assembly containing embedded resources. I tried to enhance the VirtualPathProvider from the blog post, so that an assembly can be passed into it and it loads the resource from

VirtualPathProvider not parsing razor markup

元气小坏坏 提交于 2019-12-13 02:14:09
问题 I am using a VirtualPathProvider to load razor views from the database as discussed in this article. The problem is when the view loads, the Razor markup is not being parsed. It is being rendered on the page exactly like this "@inherits System.Web.Mvc.WebViewPage hello world " For this example, i have hard-coded the string to be returned by the GetContent() method. Here is my code: public class MvcVirtualPathProvider : VirtualPathProvider { // virtualPath example >> "~/Views/View/21EC2020

SharePoint, VirtualPathProviders and Application Restarts

空扰寡人 提交于 2019-12-12 09:24:13
问题 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 master pages and page layouts are updated and published frequently, correct? (Is the lack of info on this attributed to it being a more theoretical limit that's

Cannot debug EmbeddedResource views loaded via custom VirtualPathProvider

好久不见. 提交于 2019-12-12 07:47:47
问题 I have written a custom VirtualPathProvider (source here) which will return content from EmbeddedResources, or from the original file if it has been told where to find it (this allows you to edit and update the files without having to rebuild). This is working fine, so far. What isn't working is debugging. If I add a breakpoint to the view, it doesn't load the symbols. I can see why this is difficult (how can the ASP compiler know where the source file is, in order to spot the breakpoints?),

VirtualPathProvider - disabling caching hangs server (IIS and Cassini)

北慕城南 提交于 2019-12-12 04:49:42
问题 I have a Virtual Path Provider on a Web site. It does exactly what I want it to do with the simple exception that it hangs the server. This usually only happens if too many requests come in at the roughly the same time. When I remove the caching overrides altogether the VPP and the server run fine but it caches content which must be dynamic. The method that I used to disable caching (which works) is simple: /* AppStart class */ public static void AppInitialize() { string strPath =

Maintaining cache control property on a file when it is returned as Stream from VirtualPathProvider

浪子不回头ぞ 提交于 2019-12-11 15:25:42
问题 I have implemented a VirtualPathProvider to return Theme files (images,css) for an Azure web site from the Azure CDN. It is working fine apart from one thing: the files that are coming from the CDN all have their cache control property set to "private" and so are never cached. The actual blobs have their properties set correctly and if I access one by it's direct URL (i.e. not through the VPP) then the cache control is correct. The problem seems to be in the Open() method of the VirtualFile

How to add a working aws S3 virtualpath provider for EpiServer pagefiles?

戏子无情 提交于 2019-12-11 04:37:49
问题 I'm running a EpiServer project where i want to take use of Amazon S3, to host images, etc... there will be alot of images that will exist from the pagefiles directory. I've downloaded NuGet for Visual Studio and added the AWSSDK and Geta.AmazonS3 libraries to be able to add Amazon S3 as virtual path provider. I added this line to EpiServer.config: <add showInFileManager="true" virtualName="AWS Global Files" virtualPath="~/AWS-S3/" bucketName="s3bucket" verticalDir="CS" bypassAccessCheck=

ASP.net UserControl and AppDomain TypeResolve

ⅰ亾dé卋堺 提交于 2019-12-10 15:53:29
问题 I'm using a VirtualPathProvider to include usercontrols that are not available at compile-time. Everything is working correctly except for the reference to the dll that actually contains the control. When the page that has the control is called it can't find the control type unless I put the dll on the bin folder. Error: Parser Error Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and

ASP.NET Bundling/Minification and Embedded Resources

£可爱£侵袭症+ 提交于 2019-12-09 04:44:55
问题 I'm trying to use the technique described in this blog to add embedded dll resources to my bundles. I have created the custom VirtualPathProvider below. public class EmbeddedVirtualPathProvider : VirtualPathProvider { private Type _rootType; public EmbeddedVirtualPathProvider(Type rootType) { _rootType = rootType; } public override bool FileExists(string virtualPath) { if (IsEmbeddedPath(virtualPath)) return true; else return Previous.FileExists(virtualPath); } public override CacheDependency

Problem with Master Page and Virtual Path Provider

。_饼干妹妹 提交于 2019-12-08 02:07:49
问题 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 said, now, my <asp:Content> tags get really confused and I cant CTRL K + CTRL + D my content pages anymore, it throws validation errors on EVERYTHING. HELP!