0

I've got a c# based asp.net mvcish website which is giving me grief upon visiting the page via https outside of the server it's hosted on.

Part of BundleConfig.cs:

public class BundleConfig { public static void RegisterBundles(BundleCollection bundles) {

          bundles.Add(new ScriptBundle("~/bundles/libraries").Include(
                      "~/Scripts/libs/angular.js", 
                      "~/Scripts/libs/jquery.js", 
                      "~/Scripts/libs/bootstrap.js",
                     "~/Scripts/libs/respond.js",
                    "~/Scripts/libs/angular-route.js", 
                    "~/Scripts/libs/ng-table.js",
                     "~/Scripts/libs/ui-bootstrap-tpls.js", 
                   "~/Scripts/libs/angular-resource.js", 
                   "~/Scripts/libs/loading-bar.js",
                     "~/Scripts/libs/angular-animate.js", 
                   "~/Scripts/libs/angular-cookies.js", 
                    "~/Scripts/libs/angular-translate.js",
                     "~/Scripts/libs/angular-translate-loader-url.js",
                     "~/Scripts/libs/angular-translate-storage-local.js", 
                    "~/Scripts/libs/angular-translate-loader-static-
                     files.js",
                     "~/Scripts/libs/angular-translate-storage-
                    cookie.js",
                     "~/Scripts/libs/toaster.js", 
                   "~/Scripts/libs/angular-local-storage.js",
                      "~/Scripts/libs/ng-table-export.js", 
                   "~/Scripts/libs/alasql.js","~/Scripts/libs/isteven- 
                    multi-select.js")); 





        bundles.Add(new 
   ScriptBundle("~/bundles/myAngular").IncludeDirectory("~/Scripts/app/", 
   "*.js", true));

These Bundles are used in Views/Shared/_layout.cshtml

@Scripts.Render("~/bundles/libraries") @Scripts.Render("~/bundles/myAngular")

I've only run in to this issue once https was switched on in IIS for this site.

The issue is that upon loading the site externally, I get a referenceerror: angular is not defined in site/bundles/myAngular

myAngular isn't referenced anywhere else other than _layout.cshtml

Have tried many tricks referenced on the stackoverflow to no success, any assistance would be much appreciated.

  • is it working on Visual studio? and not working on IIS ? – Umair Anwaar Aug 03 '17 at 06:06
  • No no, it works fine on IIS until you set it up to run under https. – user2814916 Aug 03 '17 at 06:19
  • Can u check in Browser developer tool that is `@Scripts.Render("~/bundles/libraries")` working fine and loading all of the files in libraries. using https – Umair Anwaar Aug 03 '17 at 06:40
  • There is a successful get for both libraries?v= and myAngular?v= which are the names of the bundles. I'm seeing that in the network tab of firefox's f12 section. Could this be an iis setting/some other web.config, as I couldn't replicate locally using a vm to visit the site locally on my machine? – user2814916 Aug 04 '17 at 04:03

0 Answers0