1

We have a MVC5 project that have a lot of script files and styles, and we use System.Web.Optimization.

The issue is when deploy to azure we have error like the below:

Object reference not set to an instance of an object.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.

Source Error: 
Line 4:  
Line 5:  @section scripts{
Line 6:      @Scripts.Render("~/bundles/timeApp")
Line 7:      <script>

Please note that it is working normally in local machine.

we tried to downgrade "WEBGREASE" but with no luck

Thanks.

Khalid Abdlqader
  • 311
  • 4
  • 11
  • http://stackoverflow.com/questions/24009122/asp-net-mvc5-webrole-after-deployed-to-azure-cloud-breaks-on-scripts-render – Evgeniy Nov 18 '14 at 14:49

1 Answers1

-2

In multiple instances when I ran in to this issue, it was related to errors in JavaScript. Comment out all of the files being loaded and test, then uncomment sections at a time and retest to see when you reintroduce the error and that will lead you to the root cause.

Masoud Safi
  • 102
  • 1
  • 6