Tips on getting your ASP.NET MVC questions answered quickly
When you run into an issue or have a question about ASP.NET MVC the best place for it is the MVC Forum. When you write your question, there are a few simple things that you can do to make it easier for the ‘experts’ to answer (and hence to get an answer quicker!).
1. Mention what environment you’re running in
-
What web server are you using
Most likely, you are using either “Cassini” (the test web server built in Visual Studio), IIS6 (XP), or IIS7 (on Vista, Windows 7 or Windows Server 2008). In many cases it makes a relevant difference, so it’s good to mention it.
-
What MVC release are you using
The official release of MVC is version 1. The latest preview is MVC 2/Preview 2. There are also various preview bits and samples that you can download from Codeplex. Just mention exactly what you are using. If you’re using some preview bits, you can include a link to them to them to remove any ambiguity.
- Mention which version of the .NET Framework you’re using, e.g. 3.5, 3.5 SP1, 4.0 Beta 2.
2. Try to isolate the issue
If an issue you see in a complex scenario can also be seen in a simpler scenario, it is always better to report it on the simpler scenario. It makes the question shorter and easier to read, as it keeps it focused on the essential. You will get your question answered much quicker if you can reproduce the problem with the simplest possible code. More likely than not, you'll figure out the problem when you make the simple repro.
4. Include complete stack traces
If you’re getting an error in the browser, make sure you include the full stack trace that you see in there, and not just the text of the error. Looking through a stack trace can reveal some important clues about the issue. If you don't get a stack trace, make sure you disable Step Into Just My Code. A stack trace is shown below.
Server Error in '/' Application.
Attempted to divide by zero.
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.DivideByZeroException: Attempted to divide by zero.
Source Error:
Line 16: public ActionResult About() {
Line 17: int x = 0, y = 1, z;
Line 18: z = y / x;
Line 19: return View();
Line 20: } |
Source File: s:\rm\MvcStackTrace\MvcStackTrace\Controllers\HomeController.cs Line: 18
Stack Trace:
[DivideByZeroException: Attempted to divide by zero.]
MvcStackTrace.Controllers.HomeController.About() in s:\rm\MvcStackTrace\MvcStackTrace\Controllers\HomeController.cs:18
lambda_method(ExecutionScope , ControllerBase , Object[] ) +40
System.Web.Mvc.ActionMethodDispatcher.Execute(ControllerBase controller, Object[] parameters) +17
System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters) +178
System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters) +24
System.Web.Mvc.<>c__DisplayClassd.<InvokeActionMethodWithFilters>b__a() +52
System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func`1 continuation) +254
System.Web.Mvc.<>c__DisplayClassf.<InvokeActionMethodWithFilters>b__c() +19
System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodWithFilters(ControllerContext controllerContext, IList`1 filters, ActionDescriptor actionDescriptor, IDictionary`2 parameters) +192
System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName) +392
System.Web.Mvc.Controller.ExecuteCore() +138
System.Web.Mvc.ControllerBase.Execute(RequestContext requestContext) +39
System.Web.Mvc.ControllerBase.System.Web.Mvc.IController.Execute(RequestContext requestContext) +7
System.Web.Mvc.<>c__DisplayClass8.<BeginProcessRequest>b__4() +34
System.Web.Mvc.Async.<>c__DisplayClass1.<MakeVoidDelegate>b__0() +21
System.Web.Mvc.Async.<>c__DisplayClass8`1.<BeginSynchronous>b__7(IAsyncResult _) +12
System.Web.Mvc.Async.WrappedAsyncResult`1.End() +138
System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) +44
System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncResult result) +7
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +8678910
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +155
|
Version Information: Microsoft .NET Framework Version:2.0.50727.4200; ASP.NET Version:2.0.50727.4016