Results 1 to 4 of 4
  1. #1
    Join Date
    Jan 2014
    Location
    Lynnwood, WA
    Posts
    46

    MVC Deployment - Problem with Script Bundler

    So i deployed my MVC project up to an azure website, but i can't get the script bundler to work properly. At first I thought I did something wrong along the process, but rewatching the deploy and conclusion videos, it looks like nelson's code has the same issue. It can be seen by looking at "Posted:". In a localhost version, it works fine, but the deployed version has nothing. Has anyone solved this issue? I also asked on Stack overflow, i implemented the comment there, but it still does not work.

  2. #2
    Join Date
    Feb 2014
    Posts
    273
    Sorry, but I don't understand your problem. What is "Posted:"?

    Do you mean script bundles in the app_config/BundleConfig.cs?
    I re-watched the "Deploying to Production - Deploying to Windows Server 2012" and the "Deploying to Production - Series Conclusion" videos again and don't see a problem that wasn't fixed.
    What exactly isn't happening on Azure? It does work on server 2012. Is it a web deploy problem?

  3. #3
    Join Date
    Jan 2014
    Location
    Lynnwood, WA
    Posts
    46
    Something about the Release version of the site results in the bundler not doing something right. I had to disable it in order to get my scripts functional on the Azure site.

    If i understand the bundler right - it doesnt actually do its bundling in the debug version of the code, but when you set to release, it does do it, problem is the bundled script file it creates is not accessible.

    A way to test it is in the localhost version, set to release and then when you load the page, look at Posted: (timeago time stamp wont show).

  4. #4
    Join Date
    Feb 2014
    Posts
    273
    um, I see what you mean now. In Nelson's final video the timeago indeed shows a blank throughout the entire video!

    I know that in my own use of timeago in the mmo project, it works fine even when minified. (ie production build where the individual .js files on the webpage files are replaced with a compressed version) And as he points out Production build is what minifies the code.

    I'd try 2 things:
    1. Try re-ordering the lines in the "~/scripts" bundle in BundleConfig.cs to put the jquery.timeago.js line lower down
    or
    2. Try out another script: eg timeago.js from https://gitlab.com/gitlab-org/gitlab..._requests/6274
    3. Re-write the code so it looks more like the mmo code

    ie something like:
    Code:
    var postScripts = new ScriptBundle("~/scripts");
       postScripts.Include("~/scripts/jquery-3.1.1.js", "~/scripts/jquery.timeago.js", "~/scripts/bootstrap.js",    "~/scripts/Frontend.js");
        postScripts.Transforms.Add(new JsMinify());
        bundles.Add(postScripts);
    replace the version of jquery you are using of course.

    Hope you can get it working.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •