a developer's notes – a semi-technical web development BLOG

September 29, 2011

“No symbols have been loaded for this document” when trying to debug on a ASP.NET MVC .aspx View page

Filed under: General Tips — Duy Nguyen @ 5:50 pm
Tags: , , , , , , , , , , , , , ,

Problem:
I was always able to set a break point on any server side code within an MVC .aspx View page.

Server side code like this:

<a href="url">Link text1</a> 

//(Sever side code is code that is between <% and %>
<%                
	string x = "";
	if (ViewData["status"] != null)
	{
		x = ViewData["status"].ToString();
	}
%>

<a href="url">Link text2</a> 

Then while coding, all of a sudden I lost that ability. When you hover over the breakpoint, it would say “The breakpoint will not currently be hit. No symbols have been loaded for this document.” The strangest part is that I was able to set a break point on the controller of the view!

Resolution:
There is some server side code that is throwing an error. Remove all code and put in a simple statement such as int x = 0;

Then set a break point on that. When I did that, I was able to hit the break point, then use the immediate window to make sure the code I was trying to use wasn’t throwing any errors.

Advertisements

1 Comment »

  1. Thanks! Saved my ass.

    Comment by Dan — August 5, 2013 @ 9:03 am | Reply


RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Create a free website or blog at WordPress.com.

%d bloggers like this: