Asp.net mvc 4 MVC4束模式错误

Asp.net mvc 4 MVC4束模式错误,asp.net-mvc-4,Asp.net Mvc 4,我在MVC4中被捆绑住了。我已经定义了bundle bundles.Add(new ScriptBundle("~/bundles/maps").Include("~/Scripts/map.*.js")); 和脚本 map.base.js map.helper.js 在我添加之前,这还可以 map.setting.js 在那之后我犯了一个错误 Invalid pattern: 'map.*.js'. Wildcards are only allowed in the last path

我在MVC4中被捆绑住了。我已经定义了bundle

bundles.Add(new ScriptBundle("~/bundles/maps").Include("~/Scripts/map.*.js"));
和脚本

map.base.js
map.helper.js
在我添加之前,这还可以

map.setting.js
在那之后我犯了一个错误

Invalid pattern: 'map.*.js'. Wildcards are only allowed in the last path segment, can contain only one leading or trailing wildcard, and cannot be used with {version}.
参数名称:VirtualPath

有没有办法在不列出所有文件的情况下解决这个问题(我希望添加更多带有“map.”前缀的文件)


感谢您的帮助。

这似乎是当前捆绑包版本的一个恼人的限制

你可以写:

.Include("~/Scripts/map.*")
当然,它可能会拾取
~/Scripts/map.a.txt
(不确定,没有测试边缘大小写)。只要给定路径中只有.js资源,
map.*
是安全的