BundleTable.Bundles.GetBundleFor() returns but not Items inside

前端 未结 1 1170
刺人心
刺人心 2021-01-06 19:17

Briefly:

Bundles which contain items from a VirtualPath (Served by custom VirtualPathProvider) don\'t work. Hash isn\'t generated in the

相关标签:
1条回答
  • 2021-01-06 19:44

    You need to register your VirtualPathProvider before bundle registration, in order to be able to find your files. Any files not found will not be included in bundle.Items

    var vpp = new MyVirtualPathProvider();
    BundleTable.VirtualPathProvider = vpp;
    BundleConfig.RegisterBundles(BundleTable.Bundles);
    

    Unless of course you already have it registered as HostingEnvironment.VirtualPathProvider.

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