If your bundles are not getting configured properly in your server, I have fixed this issue, and here I am going to share with you how you can also fix this error. I hope you will like this.
Background
Recently, I hosted one of my MVC applications to Microsoft Azure cloud. And we usually publish our application in release mode, right? So here comes the problem. You can replicate the same issue in your local machine itself. Just make the debug attribute to false in your Web.config as follows.
- <compilation debug="false" targetFramework="4.5" />
And when you run, you will get a prompt as follows.
Just select Run without debugging option. Now once after your application is run, you can see some script errors in your browser console saying that the references are not loaded correctly.
And finally I found the solution. Here we will see that.
"Bundles Are Not Working After Hosting To MVC Application"
As I said, the problem is with your bundle config settings. There are few things you must check before going to the last fix.
- Please make sure that you have used StyleBundle for creating the style bundle.
- Please make sure that you have used ScriptBundle for creating the style bundle.
- Make sure that you are loading the styles using @Styles.Render.
- Make sure that you are loading the scripts using @Scripts.Render.
- Make sure that the folder structure is same as you have in local system.
If none of the above solution works, you can try the last one. - Make sure that virtual path of bundles doesn’t contains the folder names you have in your solution.




Sibeesh VenuPosted May 4, 2016, 12:36 PM
Jaipal Reddy Thanks a lot
Jaipal ReddyPosted May 4, 2016, 6:19 AM
Nice. .
Sibeesh VenuPosted May 4, 2016, 1:18 AM
Bhavik Patel Thanks much
Sibeesh VenuPosted May 4, 2016, 1:17 AM
Munesh Sharma Thanks much
Bhavik PatelPosted May 3, 2016, 9:41 PM
useful
Munesh SharmaPosted May 3, 2016, 2:17 PM
good one
Sibeesh VenuPosted May 3, 2016, 11:36 AM
Debasis Saha Thanks much
Sibeesh VenuPosted May 3, 2016, 11:36 AM
Vignesh Mani Thank you
Sibeesh VenuPosted May 3, 2016, 11:36 AM
Pankaj Kumar Choudhary Thanks dude
Sibeesh VenuPosted May 3, 2016, 11:36 AM
Bhuvanesh Mohankumar As I am using jQwidgets in my project, I just named like that dude.
Debasis SahaPosted May 3, 2016, 9:32 AM
Good One..
Vignesh ManiPosted May 3, 2016, 8:40 AM
Good one
Pankaj Kumar ChoudharyPosted May 3, 2016, 8:20 AM
Nice Information Sir.......
Bhuvanesh MohankumarPosted May 3, 2016, 8:14 AM
Is that "JQWidget" is a kind of reserved name or that folder accessibility is the reason?
Sibeesh VenuPosted May 3, 2016, 7:51 AM
Amit Dave Thanks a lot
Amit DavePosted May 3, 2016, 6:51 AM
Good share!