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

October 31, 2014

Remote Debugging Android Devices – No Devices Detected

Filed under: General Tips — Duy Nguyen @ 2:14 pm
Tags: , , , , , ,

If you are trying to remote debug an Android phone, but Chrome Dev tools won’t detect the device, try this:

Download the Android SDK. Unzip it. The adb folder should be called something like “adt-bundle-windows-x86_64-20140702”.

Here’s how I fixed it (Windows 7).
1. Open command prompt and change directory to the adb folder. In my machine, its:
cd C:\adt-bundle-windows-x86_64-20140321\sdk\platform-tools
2. Run adb manually:
adb.exe
3. Detect the devices:
adb.exe devices
4. Check the inspect devices screen in chrome now and you should have the connected devices listed.
Hope this helps.

Advertisements

April 6, 2013

Visual Studio 2012 Run tests in current context – Debug tests in current context

There is no longer a “Run tests in current context” or “Debug tests in current context“.

There is just a “Run Tests” and “Debug Tests” but they work exactly the same way as the old commands. If you right click within the body of a single test and select “Run Tests” it will run just that test now (as opposed to running all the tests in the class which was the behavior in the RC). If you click outside the method body but within the test class and select “Run Tests” it will run all the tests in that test class.

runTests

March 27, 2013

How to debug into javascript/jquery when working with Visual Studio

Filed under: ASP.NET,Javascript / JQuery — Duy Nguyen @ 12:12 am
Tags: , , ,

Add debugger in your javascript code.

Within your Javascript code, add the line

debugger;

1. Using Visual Studio:
You can execute (F5) your application and debug with Visual Studio and the application will stop on your line of code. Note** You have to use Internet Explorer if you want to use Visual Studio.

js_vs

2. Use Chrome:
Just add the same line of code but have the Developer Tools open when you navigate to your page that executes your javascript code.

js_chrome

3. Use Firefox:
Just add the same line of code but have Firebug open when you navigate to your page that executes your javascript code.

js_firefox

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

Debugging into Classic ASP with Visual Studio

Filed under: Classic ASP — Duy Nguyen @ 2:22 pm
Tags: , , , , ,

1. First, navigate to the page your trying to debug into to load the IIS Worker Process.

2. Enable “Script source access” in IIS under the Home Directory tab. This allows VS to access the script files in ASP

3. In the Home Directory tab, click Configuration under application settings. Then click the Debugging tab. Check the box for Enable ASP server-side script debugging.

4. In Visual Studio, you need to enable Just-In-Time debugging for script files. In VS2008 go to Tools -> Options. Navigate to Debugging -> Just-In-Time. Click the check box to enable scrip debugging:

5. Add a “stop” statement to your VB code where you want the JIT debugger to break execution.

6. Finally, use the attach to process feature. In the Debug menu in VS2008. Ensure that “Attach to:” has “Script” selected and that your w3wp.exe has “Script” as one of the Types. If “Script” is not listed in the types, you have not configured IIS correctly for debugging.

7. You should now be able to navigate to the page you are trying to access. The debugger should load when the stop statement is reached and you can use the Debugging controls inside Visual Studio.

How to use Microsoft’s DebugView with ASP.NET for debugging

Filed under: General Tips — Duy Nguyen @ 2:17 pm
Tags: , , , , ,

This is a great article.

UPDATE: But this doesn’t seem to work with .NET 4 web apps. Only 3.5 or less.

http://www.dotnetcurry.com/ShowArticle.aspx?ID=337

Create a free website or blog at WordPress.com.