asp.net bundle and minification question

Hi Experts,

in the below code, I am using bundling feature of asp.net, it works well however I am referring the local files, I want to refer the files from some cdn url, how can I do that. There are total of 2 css files and 2 js files which I want to refer from cdn urls.

public static class BundleConfig
    {
        public static void RegisterBundles(BundleCollection bundles)
        {
            if (bundles != null)
            {
              var CssBundle = new StyleBundle("~/content/StyleBundle").Include(
                    "~/content/bootstrap.css",
                    "~/content/font-awesome.css",
                    "~/content/toastr.css",
                    "~/content/ng-grid.css",
                    "~/content/avb4gjz-d.css",
                    "~/content/tree-control.css",
                    "~/content/tree-control-attribute.css");

var JsBundle = new ScriptBundle("~/scripts/JSBundle").Include(
                    "~/scripts/jquery-{version}.js",
                    "~/scripts/jquery-migrate-1.2.1.js",
                    "~/scripts/fastclick.js",
                    "~/scripts/angular.js",
                    "~/scripts/angular-tree-control.js");

                JsBundle.Transforms.Clear();
		bundles.Add(CssBundle);
                bundles.Add(JsBundle);
              }
           }
      }

Open in new window

Dinesh KumarAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

MrunalCommented:
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Dinesh KumarAuthor Commented:
I want to directly refer these urls becuase these JS  files keep on updating.

I tried this: http://www.dotnetjalps.com/2014/07/cdn-in-aspnet-mvc-bundling.html

however it did not work.
0
MrunalCommented:
Hi Dinesh,
Bundling is used for static files and CDN is used mainly for referencing files according to geological locations.
There are other benefits also of CDN. If you add CDN reference with bundling then you will not get these other benefits.

Both are different things.

For version control, you need to first check dependency of new version with your existing code for any errors. If it is compatible with no errors then only go ahead with new version.

Hope this helps you.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP.NET

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.