When I run my application locally, the javascript references work as expected, but when I deploy it to our dev servers, it adds jquery 2.0.2 reference right before the 2.0.3 reference.
Why is it adding this?
I'm guessing it shouldn't interfere since it's loading first... anything in 2.0.3 should overwrite anything in the previous version, but it seems unnecessary.
Packages file:
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Antlr" version="3.5.0.2" targetFramework="net45" />
<package id="bootstrap" version="3.0.3" targetFramework="net45" />
<package id="jQuery" version="2.0.3" targetFramework="net45" />
<package id="Microsoft.AspNet.Mvc" version="5.0.0" targetFramework="net45" />
<package id="Microsoft.AspNet.Razor" version="3.0.0" targetFramework="net45" />
<package id="Microsoft.AspNet.Web.Optimization" version="1.1.2" targetFramework="net45" />
<package id="Microsoft.AspNet.WebApi" version="5.0.0" targetFramework="net45" />
<package id="Microsoft.AspNet.WebApi.Client" version="5.0.0" targetFramework="net45" />
<package id="Microsoft.AspNet.WebApi.Core" version="5.0.0" targetFramework="net45" />
<package id="Microsoft.AspNet.WebApi.WebHost" version="5.0.0" targetFramework="net45" />
<package id="Microsoft.AspNet.WebHelpers" version="3.0.0" targetFramework="net45" />
<package id="Microsoft.AspNet.WebPages" version="3.0.0" targetFramework="net45" />
<package id="Microsoft.AspNet.WebPages.Data" version="3.0.0" targetFramework="net45" />
<package id="Microsoft.AspNet.WebPages.WebData" version="3.0.0" targetFramework="net45" />
<package id="Microsoft.Web.Infrastructure" version="1.0.0.0" targetFramework="net45" />
<package id="Newtonsoft.Json" version="5.0.8" targetFramework="net45" />
<package id="Twitter.Bootstrap" version="3.0.1.1" targetFramework="net45" />
<package id="WebGrease" version="1.5.2" targetFramework="net45" />
</packages>
BundleConfig:
bundles.Add(new ScriptBundle("~/js")
.Include("~/Scripts/jquery-{version}.js")
.Include("~/Scripts/bootstrap.js")
.Include("~/Scripts/bootstrap-windows.js")
.Include("~/Scripts/MyProject.js")
);
Output when running locally:
<script src="/MyProject/Scripts/jquery-2.0.3.js"></script>
<script src="/MyProject/Scripts/bootstrap.js"></script>
<script src="/MyProject/Scripts/bootstrap-windows.js"></script>
<script src="/MyProject/Scripts/MyProject.js"></script>
Output when on development server:
<script src="/MyProject/Scripts/jquery-2.0.2.js"></script>
<script src="/MyProject/Scripts/jquery-2.0.3.js"></script>
<script src="/MyProject/Scripts/bootstrap.js"></script>
<script src="/MyProject/Scripts/bootstrap-windows.js"></script>
<script src="/MyProject/Scripts/MyProject.js"></script>
Could it be that /MyProject/Scripts/jquery-2.0.2.js
is actually there, on the disk, on the development server? The {version}
wildcard of .Include("~/Scripts/jquery-{version}.js")
would then cause it to be included.
For more on bundling you may want to check out Bundling and Minification on www.asp.net.