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.

4

2 回答 2

3

我有同样的问题。根本原因是我在包中只包含了缩小的脚本。一旦我将未压缩的脚本放入脚本目录中,它就会正确呈现它们。

于 2013-01-16T11:35:50.820 回答
1

不幸的是,捆绑还不支持 VirtualPathProviders,因此如果您的虚拟路径依赖于 VPP 来提供资源,捆绑将无法找到它们。这是我们目前正在调查的一个场景,希望很快能得到支持。

于 2012-07-27T19:40:38.680 回答