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

October 4, 2011

Can’t debug into a Javascript file. Error “No Disassembly Available” or “This breakpoint will not currently be hit. No symbols have been loaded for this document”

Ever put a break point in visual Studio 2010 on a .js file to get this?

This breakpoint will not currently be hit. No symbols have been loaded for this document.”

Then you decide to user the ‘debugger;’ statement. But then Visual Studio gives this error: “no disassembly available“.

You are probably loading your .js file dynamically. If you are, remove (or comment out) where you are loading and load it with an explicit script tag.

example: I was loading the script file like this:

<script src="<%=Url.StaticContent("/MyApplication/Scripts/views/script.js")%>" type="text/javascript" ></script>

I just commented out that line and hard coded the script file like this:

<script src="http://localhost/MyApplication/Scripts/views/script.js" type="text/javascript"></script>

Now I am able to user the debugger; statement AND able to put a break point in Visual Studio.

Advertisements

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.

September 5, 2011

There Is No Source Code Available For the Current Location

Filed under: ASP.NET — Duy Nguyen @ 2:25 pm
Tags: , , , , , , , , , , , , , ,

(Taken from:http://www.marvinpalmer.com/MarvinPalmer/post/There-Is-No-Source-Code-Available-For-the-Current-Location.aspx

When using trying to debug with Visual Studio and programming using .NET, you get a Visual Studio dialog that says “There is no source code available for the current location.”

1.The “Show Disassembly” button will be available. Click on it. You can step through the disassembly which does eventually take you into the code.
2. If you click “Show Disassembly” and then “Step Into” code (F11) just like you would have if the code window had loaded, you will see code mixed with other stuff.
3. When you see the code to debug, just right-click the window and choose “Go to Source Code” which opens up the code

A selected drive is no longer valid. Please review your installation path settings before continuing with setup.

Filed under: General Tips — Duy Nguyen @ 1:09 pm
Tags: , , , , , , ,

When you try to change an installed component in Visual Studio 2008 and get the message:

“A selected drive is no longer valid. Please review your installation path settings before continuing with setup.”

Uninstall Visual Studio 2008 SP1, then try again.

Create a free website or blog at WordPress.com.