2

I have a modular asp.net app where the modules are deployed inside virtual directories underneath the primary .net web application. We have a common module with a lot of stuff. I tried to move all of the common script files out of each client specific project into a common module.

If I create a script bundle that references files at the root level, it renders the script tag into the html. But it won't render script tags for bundles that point to files in a sub virtual directory.

For example:

bundles.Add(new ScriptBundle("~/bundles/jquery").Include(
                    "~/App_Modules/Common/Scripts/jquery-1.*"));

no longer renders any script tag and now I get jquery errors client side. I looked at the resultant html, and now there's no more script tag to download the jquery library.

jrummell
  • 42,637
  • 17
  • 112
  • 171
happyfirst
  • 1,033
  • 1
  • 13
  • 27

2 Answers2

3

I had the same problem. The root cause was that I included only minified scripts in the bundle. Once I placed in the scripts directory the uncompressed scripts, it rendered them correctly.

Koby Mizrahy
  • 1,361
  • 2
  • 12
  • 23
1

Unfortunately bundling doesn't yet support VirtualPathProviders so if your virtual paths are relying on a VPP to serve the resource, bundling won't be able to find them. This is a scenario we are investigating currently and hopefully will support soon.

Hao Kung
  • 28,040
  • 6
  • 84
  • 93
  • I do not have a virtual path provider. I just have my web project using IIS server and there I have a virtual directory configured that points to all my common files. – happyfirst Jul 27 '12 at 19:51
  • @hao-kung was this functionality supported in V1.1.0? was it done as part of this issue? http://aspnetoptimization.codeplex.com/workitem/68 – Tim Apr 23 '15 at 08:38
  • Yeah this support was eventually added – Hao Kung Apr 25 '15 at 03:51