I deployed my MVC-3 application on windows Azure. But now when I am requesting it through staging url it shows me (Sorry, an error occurred while processing your request.). Now I want to see the full error message, by default it is hiding that because of some security reasons. I know that we can do this through web.config file. But how?
Asked
Active
Viewed 3e+01k times
172
Kolappan N
- 2,875
- 2
- 31
- 38
King Kong
- 2,775
- 5
- 27
- 39
3 Answers
284
Not sure if it'll work in your scenario, but try adding the following to your web.config under <system.web>:
<system.web>
<customErrors mode="Off" />
...
</system.web>
works in my instance.
also see:
Uwe Keim
- 38,279
- 56
- 171
- 280
jim tollan
- 22,085
- 4
- 45
- 63
-
24In addition add the following in the < **System.webServer** > add
– Kasper Halvas Jensen Sep 14 '16 at 06:21
154
This can also help you by showing full details of the error on a client's browser.
<system.web>
<customErrors mode="Off"/>
</system.web>
<system.webServer>
<httpErrors errorMode="Detailed" />
</system.webServer>
Leyla Zwolinski
- 85
- 7
Meer
- 2,627
- 2
- 18
- 28
-
1For more detail see [customErrors Element (ASP.NET Settings Schema)](https://msdn.microsoft.com/en-us/library/h0hfz6fc(v=vs.85).aspx) – stomy Oct 30 '17 at 16:58
-
See [httperrors](https://docs.microsoft.com/en-us/iis/configuration/system.webserver/httperrors/) – stomy Oct 30 '17 at 17:01
-
See [the difference between customErrors and httpErrors](https://stackoverflow.com/a/2481102/7794769) – stomy Oct 30 '17 at 17:05
-
3This is better than the accepted answer bcuz most devs want to see the details instead of YSOD with no details. – Spencer Nov 30 '17 at 18:12
16
If you're using ASP.NET MVC you might also need to remove the HandleErrorAttribute from the Global.asax.cs file:
public static void RegisterGlobalFilters(GlobalFilterCollection filters)
{
filters.Add(new HandleErrorAttribute());
}
Sandrino Di Mattia
- 24,589
- 2
- 56
- 65