Lazycoder

12Sep/081

Debugging Managed Web Applications on x64

I ran into an interesting problem a while back. I needed to fire up the debugger and figure out what was going on in a web application. I tried my usual keystroke, F5, to start debugging the web application but received an exception telling me that the debugger could not start.

CannotStartDebugger

No big deal, I’ll just attach to the web server process. Ah, but there’s a catch. I’m running Windows XP 64-bit. My web application is written in managed .NET code but it’s running on IIS which is native x64 code. So when I look at my process list, I see that T-SQL, Managed, and Native code is running in that process.

AttachToProcess

If I let the “Attach to process” dialog pick the correct debugger for me, it appears to try and debug the native x64 code running in that process. Since I’m trying to debug my managed application, I guess the debugger can’t switch between managed code and native code.(1).

So the key here is to make sure I select “Managed code” from the debugger dialog.

SelectDebugger

This ensures that I’m using the correct debugger and my breakpoints are getting hit.

Now, I’m back to having to figure out what the application is doing.

(1) – I’m sure there is a better technical explanation for what is happening here. If anyone can explain it better, please leave a comment with the explanation or a link to a blog/forum/arcticle.

Filed under: .NET 1 Comment
24Jun/081

Herding Code – our podcast has a name

We finally decided on a name. Herding Code. We finally have a domain and a real, live errr, actual feed with enclosures and everything. Now you should be able to subscribe to our podcast in your favorite Apple based music manager. I’ve submitted it to the iTunes music store and hopefully it will show up there soon.

Tagged as: , , , , 1 Comment
20May/085

Why can’t you declare a static method in an interface?

I've stated on Twitter a couple of times that I'd like to be able to declare static methods as part of my interface. My reasoning is: If an interface defines a contract in my code, why can't a static method be part of that contract?

CODE:
  1. public interface ITryStatic {
  2.     static void Foo();
  3.     void Bar();
  4. }

I found a great answer over in this forum.

In both Java and .NET, classes can only inherit from one class but a class can implement multiple interfaces. So consider the following code.

CODE:
  1. public interface ITryStatic {
  2.     static void Foo();
  3. }
  4.  
  5. public interface ITryAnotherStatic {
  6.     static void Foo();
  7. }
  8.  
  9.  
  10. public class Whoops : ITryStatic, ITryAnotherStatic {
  11.     public static void Foo() { printline("Foo"); }
  12. }
  13.  
  14. ITryStatic staticWhoops;
  15. staticWhoops.Foo(); //which one does it try? It doesn't matter since there's no code to run.
  16. ((Whoops)staticWhoops).Foo(); //Sure, but it defeats the purpose of using an interface.

Essentially the answer is: The compiler tries to run the code specified by the static method in a class. Since an interface doesn't provide an implementation details, there is nothing to run. You could, if the compiler would let you, cast the interface to the concrete type that's actually being represented. But that defeats the purpose of declaring an using an interface.

I do wonder if type inference could be used to route around this problem?

16Feb/080

Google Maps for mobile rocks more than a phone

My iPhone, Six Months Later…

I've had almost those exact same experiences, but with my Blackberry Pearl instead. I think it's Google Maps Mobile that rocks more than any phone.

Google Maps works a lot better than GPS in downtown Seattle. Many times I've had friends in town with rental cars equipped with GPS and we've watched the GPS tell us to make a U-turn on a one-way street or mark our position out in the bay and tell us to "turn right". Where the cell phone tower triangulation usually gets me close enough that I can manually correct it and figure out where I need to go.

Filed under: Technology No Comments
12Feb/080

alt.net seattle registration is open

David Laribee has the details here.

You can sign up by using an OpenID provider. MyOpenId is one popular choice or you can use your Yahoo login.

I'm looking forward to it, the discussions should be interesting and enlightening.

Filed under: Technology No Comments
12Feb/080

Wil Shipley on Hype

"Hype is foreplay for geeks."

Filed under: Apple, Technology No Comments