We are developing an application in MVC5 and using Visual studio 2017. We have added all the common jquery and css files in bundle config but those are not rendering after the application is getting hosted in IIS. In the development phase, the application is working perfectly.
BundleConfig.cs
public static void RegisterBundles(BundleCollection bundles)
{
bundles.Add(new ScriptBundle("~/bundles/jquery").Include(
"~/Scripts/jquery-{version}.js"));
bundles.Add(new ScriptBundle("~/bundles/jqueryval").Include(
"~/Scripts/jquery.validate*"));
bundles.Add(new ScriptBundle("~/bundles/modernizr").Include(
"~/Scripts/modernizr-*"));
bundles.Add(new ScriptBundle("~/bundles/bootstrap").Include(
"~/Scripts/bootstrap.js",
"~/Scripts/jquery.js",
"~/Scripts/jquery.validate.min.js",
"~/Scripts/jquery.datetimepicker.full.js",
"~/Scripts/jquery-3.3.1.js",
"~/Scripts/dataTables.bootstrap4.min.js",
"~/Scripts/jquery.dataTables.min.js",
"~/Scripts/jquery.validate.min.js",
"~/Scripts/jquery.validate.unobtrusive.js"));
bundles.Add(new StyleBundle("~/Content/css").Include(
"~/Content/bootstrap.css",
"~/Content/site.css",
"~/Content/jquery.datetimepicker.css",
"~/Content/themes/base/jquery-ui.min.css",
"~/Content/jquery.dataTables.min.css"));
}
Layout.cshtml
@Styles.Render("~/Content/css")
@Scripts.Render("~/bundles/modernizr")
@Scripts.Render("~/bundles/jquery")
@Scripts.Render("~/bundles/bootstrap")
@RenderSection("scripts", required: false)
WebGrease is also added by default as a reference in the project.The same is also present in Web.Config file
<dependentAssembly>
<assemblyIdentity name="WebGrease" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="0.0.0.0-1.6.5135.21930" newVersion="1.6.5135.21930" />
</dependentAssembly>
Please help to complete the hosting.
What I have tried:
We have installed all the IIS components which were missing in the server.
Checked
WebGrease
which was a necessary thing.