1

I'm trying to correct a null reference exception in a Mvc Controller. I can't debug in Visual Studio because there are query to a database reachable only on the server. Now I have to read all the code and correct all the situation that might causes the exception or there is another way to know which is the exact variable accessed with null value? The debug yellow screen only tells me that the exception is inside the controller's code.

Thanks.

2
  • What kind of server is the application running on? IIS? Commented May 11, 2013 at 16:30
  • The app is running on IIS 6 Commented May 13, 2013 at 13:03

1 Answer 1

1

The debug yellow screen only tells me that the exception is inside the controller's code.

The YSOD is probably also highlighting the line of code on which this exception occurs. So all that's left is to fix it. Also if you have access to the server you could use remote debugging.

Sign up to request clarification or add additional context in comments.

4 Comments

[NullReferenceException: Object reference not set to an instance of an object.] MyClass.ParseProduct(ProductClass prod) +18267 What is the incremental '18267' on the right?
It's an IL offset. If you want to get line numbers you need to ship the corresponding PDB of the assembly on your webserver.
Sorry, I've searched but it's unclear to me what does mean to ship the pdb file. Could you give me some link? Thanks. In old aspx I had the information about the exact variable the caused the exception, why not in mvc?
Each assembly (.DLL) file has a corresponding (.PDB) file. In the settings of Visual Studio when compiling you could specify what debug information is included in this PDB file. wintellect.com/blogs/jrobbins/…

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.