Andrew Stevenson's WebLog

Write Here Write Now

Syndication

.Net Languages

ADO.Net

Asp.Net (Misc.)

Asp.Net Controls

Bad Patterns

Err What?

Files and Folders

Forums

IE Add-Ins

Methods for the Madness

Performance

See Clearer, C#

Test Driven

October 2005 - Posts

Does Visual Studio Rot the Mind? Slashdot Link

I liked the article and I feel the pull between "pure code" and "getting it done".

I very rarely visit slashdot, but I went yesterday and there was a thread about the Petzold article, it has some good comments.

http://it.slashdot.org/it/05/10/26/1935250.shtml?tid=156&tid=166&tid=8

Edit: I missnamed the posting, so I've updated it to what I hope is more correct.

 

Posted Thursday, October 27, 2005 2:05 PM by AndrewSeven | 3 comment(s)

Attaching the debugger to nUnit

I'm doing some heavy refactoring of a prototype using a bunch of tests in nUnit to keep things sane.

When tests fail for what seem to be strange reasons, I use attach to process to attach to the running nUnit rather than using the start button and lauching an new instance. I also use attach like this to avoid recompiling-restarting a web app.

Having reduced it to key strokes (Alt+D P, N, Enter ), I thought I would try a macro instead. I ususaly have problems with recorded macros.

I recorded it and when I executed it, it attached to the process, but wasn't deguggin anything, they Type column was empty instead of Being "T-SQL, Managed".

I played a little with the macro to change the engines used and presto: one button to attach to the first nUnit instance.

The macro

Edited to remove "Native" so that VS doesn't terminate nUnit

     Sub nUnitDebug()
        Try
            Dim dbg2 As EnvDTE80.Debugger2 = DTE.Debugger
            Dim trans As EnvDTE80.Transport = dbg2.Transports.Item("Default")
            Dim dbgeng(10) As EnvDTE80.Engine
            Dim proc2 As EnvDTE80.Process2 = dbg2.GetProcesses(trans, "ML-ANDREW-SRV").Item("nunit-gui.exe")
            Dim myEngine As Engine
            '     Dim strEngineList As String
            Dim indexer As Integer = 0
            For Each myEngine In trans.Engines
                '    strEngineList = strEngineList + myEngine.Name + ", " + _
                '   myEngine.ID(+", " + myEngine.AttachResult.ToString + System.Environment.NewLine)
                If myEngine.Name.Contains("Managed") Then
                    If myEngine.Name.Contains("Native") = False Then

                        dbgeng(indexer) = myEngine
                        indexer += 1
                        'redim preserve dbgeng)(
                        '       MsgBox("Adding" + myEngine.Name + "::" + myEngine.ID)
                    End If
                End If
            Next
            'MsgBox(strEngineList)

            proc2.Attach2(dbgeng)
        Catch ex As System.Exception
            MsgBox(ex.Message)
        End Try

    End Sub

 

 

 

Posted Friday, October 14, 2005 3:17 PM by AndrewSeven

More Posts