MVC Bundling not working on Azure deploy

working locally, but not on deploy

When using your bundler, everything may work fine, but quirks often pop up on Azure deployment, these are some of them I came across:

Styles/Javascript not rendering at all

This my be because your names resemble your directory structure, which apparently it does not like. For example, if this is your Bundle:
bundles.Add(new StyleBundle("~/Styles/Metro").Include(

And you use the render:

It will not render on Azure! Simply change it so your render string does not resemble your actual directory structure, and it will work:
bundles.Add(new StyleBundle("~/Styles/MetroCss").Include(

And you use the render:

Notice that the directory is ~/Styles/Metro but the render string is ~/Styles/MetroCss.

If that is not it, be sure you are using

for css, and:

for Javascript.

Images or Fonts not rendering

This is because you assume things will behave the same when they are up in Azure, which is not always the case. If you have this stuff outside of the ~/Content/ folder, your program will not, by default, know how to handle it. You will get a Controller error if you try to navigate to it manually.

The answer? Simply move everything somewhere within the ~/Content/ folder which MVC makes public by default. Don't forget to update your css and JavaScript accordingly!

Otherwise you can make a controller to handle these requests, but that involves more work.

Azure Error - .NET Runtime version 4.0.30319.18033 - Loading profiler failed during CoCreateInstance.

frustrating profiler error when you aren't actually using a profiler

The other day I was troubleshooting an Azure problem, and I had turned on my profiler:

Once I figured out the problem, I then turned off profiling, then re-published. Now my application would not work at all and I kept getting the error:

.NET Runtime version 4.0.30319.18033 - Loading profiler failed during CoCreateInstance.
Despite the fact that I wasn't using a profiler anymore. I rebooted and tried all sorts of other things, nothing seemed to work.

The Fix

Not to say there is not a better fix (I tried all I could find elsewhere, nothing seemed to relate to my specific problem) but here is what I ended up doing. Simply delete your deployment, and re-publish. This must re-set whatever turning on your profiler sets.

Remember that if this is a non domain dns instance, your address will be changed. Hope this can save someone a few hours.