skip to main | skip to sidebar

Breaking Builds Since 2008

Pages

  • Home

Thursday, 18 August 2011

Attach to .NET worker process

If you are sick of how much effort it takes to attach the Visual Studio debugger to a process in then try out this macro.  With one click it will find all the .NET worker processes running on your machine and attach to them all.

This is based on the code found here: http://blog.lavablast.com/post/2008/01/11/Attach-to-Process-with-one-shortcut.aspx

This is tested in Visual Studio 2008 and 2010.


Public Module AttachDebugger
    Public Sub AttachDebugger()
        Try
 
            Dim count As Integer
            count = 0
 
            Dim process As EnvDTE.Process
 
            For Each process In DTE.Debugger.LocalProcesses
                If IsTargetedProcess(process) Then
                    process.Attach()
                    count = count + 1
                End If
            Next
 
            If count > 0 Then
                MsgBox("Successfully connected to " & count & " processes.")
            Else
                MsgBox("No targeted processes found.")
            End If
 
        Catch ex As System.Exception
            MsgBox("Error: " & ex.Message)
        End Try
    End Sub
 
    Private Function IsTargetedProcess(ByVal process As EnvDTE.Process) As Boolean
 
        If process.Name.EndsWith("w3wp.exe") Then
            Return True
        ElseIf process.Name.EndsWith("aspnet_wp.exe") Then
            Return True
            'List any other processes you might commonly attach to
        ElseIf process.Name.EndsWith("NServiceBus.Host.exe") Then
            Return True
        End If
 
        Return False
 
    End Function
End Module
Posted by Mike at 08:54 1 comments Email This BlogThis! Share to X Share to Facebook
Labels: Visual-Studio

Saturday, 6 August 2011

Construction complete

My first XNA game is complete!  It's not perfect and shiny, but I'm happy I've taken it as far I wanted too.  Here is a quick video I've put together of a play-through.

You can see your character, the little yellow man tumble down into a well.  He needs to escape and raise his yellow victory flag.  Suddenly tetriminos start falling from the sky.  He has to avoid them and constantly jump and climb to stay on top and not be crushed to death.  Eventually, he jumps out of the well only to find an old foe waiting for him on the hill...



Three areas I know I can improve are:

Sound.  I haven’t added any sound effects or background music at all.  From the developer's point of view it turns out to be very similar to the sprite images.  I'm sure they would be easy enough to add in at a later date if I wanted to.

Everyone I have shown the game to raises the same point.  They all think it should be two player; the falling tetriminos controlled by the extra player.  This is slightly devastating for me, as writing a semi-believable AI for the tetriminos was the single most time consuming part.  Maybe I should pay attention to other people's opinions sooner rather than later?  Oh well.

There is a strange bug which happens sometimes when a row is deleted.  The yellow man will start floating in the air as if that row still existed.  Lucky for me this is not a published product so I don't have to get to the bottom of this one.  I wasn't trying to achieve a polished result so I'm happy to leave that bug in as a talking point.




So far my experiences with XNA have been nothing but fun.  I'm often surprised that when you ask around what other developers are working on in their spare time, it is often websites and other little libraries which are not all that dissimilar from their day jobs.  There is so much more that people could be working on and I'm not sure why more people don't do this.  Or maybe they do and I'm just not hearing about it? 

I'm interested to look around at what third party libraries are available to open more doors.  So far I have stuck to only using the framework classes to see what was really going on.  At some point soon I'll have to make the leap into 3D gaming.  XNA looks to have great support for that, but I just wonder if it will be as easy to get started, or if there is a massive step-up?  I shall keep you posted.
Posted by Mike at 09:00 0 comments Email This BlogThis! Share to X Share to Facebook
Labels: XNA
Newer Posts Older Posts Home

About Me

Mike
Keen on all things C#.
View my complete profile

Blog Archive

  • ►  2014 (1)
    • ►  July (1)
  • ►  2013 (1)
    • ►  August (1)
  • ►  2012 (1)
    • ►  March (1)
  • ▼  2011 (5)
    • ▼  August (2)
      • Attach to .NET worker process
      • Construction complete
    • ►  July (3)

Followers

Powered by Blogger.
 
Copyright (c) 2010 Breaking Builds Since 2008. Designed for Video Games
Download Christmas photos, Public Liability Insurance, Premium Themes