Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7674001
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T16:38:30+00:00 2026-05-31T16:38:30+00:00

global.asax: var desktopJsBundle = new Bundle(~/desktop-js-bundle, new JsMinify()); desktopJsBundle.AddFile(~/scripts/jquery-1.7.1.min.js); desktopJsBundle.AddFile(~/scripts/test.js); BundleTable.Bundles.Add(desktopJsBundle); layout.cshtml: <script src=@System.Web.Optimization.BundleTable.Bundles.ResolveBundleUrl(~/desktop-js-bundle)></script>

  • 0

global.asax:

var desktopJsBundle = new Bundle("~/desktop-js-bundle", new JsMinify());
desktopJsBundle.AddFile("~/scripts/jquery-1.7.1.min.js");
desktopJsBundle.AddFile("~/scripts/test.js");
BundleTable.Bundles.Add(desktopJsBundle);

layout.cshtml:

<script src="@System.Web.Optimization.BundleTable.Bundles.ResolveBundleUrl("~/desktop-js-bundle")"></script>

If I visit localhost/desktop-js-bundle/, I see similar to the following:

/*! jQuery v1.7.1 jquery.com | jquery.org/license */
function mytest(){alert('test');}(function(a,b){function cy(a){return f............

As you can see, it started with the comment that is found at top of jquery.js file, then there is the content from my test.js file, then back to the content of jquery.js file. Odd behavior. Any thoughts? Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T16:38:31+00:00Added an answer on May 31, 2026 at 4:38 pm

    There is some internal Ordering going on, it is following certain rules, you can override those rules though.

    Here is how you specify the exact order of files:

     //controls ordering for javascript files, otherwise they are processed in order of AddFile calls
     var bootstrapOrdering = new BundleFileSetOrdering("bootstrap");
    
     //The popover plugin requires the tooltip plugin
     bootstrapOrdering.Files.Add("bootstrap-tooltip.js");
     bootstrapOrdering.Files.Add("bootstrap-popover.js");
    
     BundleTable.Bundles.FileSetOrderList.Add(bootstrapOrdering);
    

    UPDATE
    I reread your question and realized that you were surprised to see the jQuery comments on top. This is due to a different reason than internal ordering:
    Basically what happens is all comments on top of the files are extracted and merged together and put on top, this is for example for licensing reasons. Often you are not allowed to redistribute a library without a license on top of it and they usually are within the comments. This way the ASP.NET team made sure they are not omitted when minifying/bundling.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I added the following lines to Application_Start method in global.asax: var provider = new
I have registered a component like this in my Global.asax.cs: ContainerBuilder builder = new
i defined two routes in global.asax like below context.MapRoute(HomeRedirect, , new { controller =
Global.asax route values routes.MapRoute( Default, // Route name {controller}/{action}/{id}, // URL with parameters new
I have code in global.asax that sets some things in cache with CacheItemRemovedCallback. When
We are trying to remove the global.asax from our many web applications in favor
I'm using code in the Application_BeingRequest() handler of my Global.asax to do some very
Is there an event that I can tap into in Global.asax to execute some
Here's my Application_OnError event sink in global.asax.vb: Sub Application_OnError(ByVal sender As Object, ByVal e
Is there a way to handle the application_start event without using the global.asax? The

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.