Click here to Skip to main content
15,892,746 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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*"));

           // Use the development version of Modernizr to develop with and learn from. Then, when you're
           // ready for production, use the build tool at https://modernizr.com to pick only the tests you need.
           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.
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900