ASP.NET Bundling/Minification and Embedded Resources

后端 未结 1 513
悲哀的现实
悲哀的现实 2021-02-05 17:17

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.

1条回答
  •  时光取名叫无心
    2021-02-05 17:37

    You will need to tell the BundleTable to use your VirtualPathProvider like this:

    BundleTable.VirtualPathProvider = new EmbeddedVirtualPathProvider(typeof(My.Custom.Type));
    

    This functionality was added in v1.1.0 of the Microsoft ASP.NET Web Optimization Framework.

    Also you need to make sure that requests for CSS file go through the ASP.NET pipeline by adding this to your web.config.

      
        
    

    The secondary problem can be solved by setting RouteCollection.RouteExistingFiles to true

    0 讨论(0)
提交回复
热议问题