Quote:
A NullReferenceException exception is thrown when you try to access a member on a type whose value is null
Possibly because:
1. You've forgotten to instantiate a reference type
2. You've forgotten to dimension an array before initializing it.
3. You get a null return value from a method, and then call a method on the returned type.
4. You're using an expression (for example, you're chaining a list of methods or properties together) to retrieve a value
5. You're enumerating the elements of an array that contains reference types, and your attempt to process one of the elements throws
6. Exception is thrown by a method that is passed null
Following will help you learn about debugging:
jdb - The Java Debugger[
^]
Debugging the Eclipse IDE for Java Developers | The Eclipse Foundation[
^]
When you debug, you will be able to get the exact line where the variable is NULL and error is being raised.
Now, here in your case, possible area to look for:
Quote:
RazorViewEngine Engine;
never instantiated
Quote:
ViewEngineResult viewResult = engine.FindView(ControllerContext, viewName, false);
If engine is null, this line would throw an error.
Try out.