I recently added the jquery.dataTables nuget package for my project, and I wanted to link the necessary files inside the BundleConfig. Since this package is installed inside the "DataTables-1.9.4" folder in the Scripts folder, I added the following line to my BundlesConfig:
bundles.Add(new ScriptBundle("~/bundles/dataTables").Include( "~/Scripts/DataTables-{version}/media/js/jquery.dataTables.js"));
However, I got the following error:
An exception of type "System.ArgumentException" occurred in System.Web.Optimization.dll, but was not processed in the user code
When I change the line to:
bundles.Add(new ScriptBundle("~/bundles/dataTables").Include( "~/Scripts/DataTables-1.9.4/media/js/jquery.dataTables.js"));
It works great.
So my question is, how is the version injected in the case of the jQuery package? Is it defined somewhere in the package itself and is there a way to fix this? I hate the idea of ββchanging the package configuration every time I update the nutet dataTables package ...
Marko
source share