Tôi có pice mã sau đó chạy một cách hoàn hảo:Ký tự đại diện gói và rút gọn mới của {.NET} không hoạt động với các thư mục?
bundles.Add
(
new ScriptBundle("~/bundles/scripts")
.Include
(
"~/Scripts/jquery-{version}.js"
,"~/Scripts/jquery-ui-{version}.js"
,"~/Scripts/jquery.unobtrusive*"
,"~/Scripts/jquery.validate*"
,"~/Scripts/fullcalendar-1.5.4/fullcalendar.js"
, "~/Scripts/DataTables-1.9.3/media/js/jquery.dataTables.js"
)
);
Nhưng sau đó tôi muốn sử dụng {version} ký tự đại diện để sử dụng tất cả các tính năng của nó tiện lợi:
bundles.Add
(
new ScriptBundle("~/bundles/scripts")
.Include
(
"~/Scripts/jquery-{version}.js"
,"~/Scripts/jquery-ui-{version}.js"
,"~/Scripts/jquery.unobtrusive*"
,"~/Scripts/jquery.validate*"
, "~/Scripts/fullcalendar-{version}/fullcalendar.js"
, "~/Scripts/DataTables-{version}/media/js/jquery.dataTables.js"
)
);
và BANG, ngoại lệ nó không hoạt động, tôi có làm gì sai không?
EDIT
thông tin Ngoại lệ: System.ArgumentException:
thư mục không tồn tại. tên Parameter: directoryVirtualPath
Stack:
[ArgumentException: Danh mục không tồn tại. Имя параметра: directoryVirtualPath]
System.Web.Optimization.Bundle.Include (String [] virtualPaths) 40
Aerostar.BundleConfig.RegisterBundles (bó BundleCollection) trong c: \ Users \ Denis \ Documents \ Visual Studio 2012 \ Projects \ Aerostar \ Aerostar \ App_Start \ BundleConfig.cs: 21
Aerostar.MvcApplication.Application_Start() trong c: \ Users \ Denis \ Documents \ Visual Studio 2012 \ Projects \ Aerostar \ Aerostar \ Global.asax. cs: 24[HttpException (0x80004005): Thư mục không tồn tại. Имя параметра: directoryVirtualPath]
System.Web.HttpApplicationFactory.EnsureAppStartCalledForIntegratedMode (HttpContext bối cảnh, HttpApplication ứng dụng) 9.859.725
System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS (IntPtr appContext, HttpContext bối cảnh, MethodInfo [] xử lý) 118
System.Web.HttpApplication.InitSpecial (HttpApplicationState nhà nước, MethodInfo [] xử lý, IntPtr appContext, HttpContext ngữ cảnh) 172
System.Web.HttpApplicationFactory.GetSpecialApplicationInstance (IntPtr appContext, HttpContext ngữ cảnh) 336
System.Web.Hosting.PipelineRuntime.InitializeApplication (IntPtr appContext) +296[HttpException (0x80004005): Thư mục không tồn tại. Имя параметра: directoryVirtualPath]
System.Web.HttpRuntime.FirstRequestInit (HttpContext ngữ cảnh) 9.873.912 System.Web.HttpRuntime.EnsureFirstRequestInit (HttpContext ngữ cảnh) 101 System.Web.HttpRuntime.ProcessRequestNotificationPrivate (IIS7WorkerRequest wr, HttpContext bối cảnh) +254
Sẽ rất hữu ích nếu bất cứ ai đọc điều này để biết * ngoại trừ * gì. =) –
Xin lỗi, tôi đã chỉnh sửa câu hỏi – Lu4