in

Platinum Bay

Peace, Love and Visual Studio Team System

.NETicated

October 2007 - Posts

  • Swing and a Miss, Minus the Swing

    So the contest I was running is over, with a startling ZERO entries. I guess no one wanted $25 to ThinkGeek.com.

    The answer? Take a look at these two lines of code:

    Dim typeName As String = Microsoft.VisualBasic.Information.TypeName(objectProvider.GetObject)
    Dim t As Type = Type.GetType(typeName, True, True)

    Got it yet? Ok, let's review.

    The TypeName method returns the underlying type name for an object, which in this case is a System.__ComObject. The underlying object that System.__ComObject is representing could be any serializable object.

    The next line then attempts to cast the object given the type name. The problem? Microsoft.VisualBasic.Information.TypeName does not return a fully qualified name, and the custom type may not be found.

    More info - http://msdn2.microsoft.com/en-us/library/microsoft.visualbasic.information.typename(vs.80).aspx

  • Debugger Visualizers

    Anyone who writes code knows that a fair amount of time is spent debugging it. Writing more than 10 lines of code invariable means there is going to be a bug or two. Sometimes, getting to the root of the problem means delving deep into the objects your code instantiates. Visual Studio provides a mechanism to explore the instantiated objects in you code, via debugger visualizers.

    Scott Mitchell has a great article outlining debugger visualizers if you would like to learn more.

    I have created a couple project templates to help you get started building debugger visualizers, one for C# and one for VB. Also in the Downloads section is a sample project to create a StringBuilder visualizer.

    StringBuilder Visualizer Sample Project

    Visual Basic Debugger Visualizer Project Template

    Visual C# Debugger Visualizer Project Template

    To use the project templates, you will need to make a couple of changes. First, in the AssemblyInfo file, change the Target in the DebuggerVisualizer attribute to the type you want to visualize. Next, build the UI in the VisualizerDialog page, and update the Class1 file to reflect the type you are visualizing.

    Enjoy!

  • Thanks Philly.NET!

    Tonight I had the honor of representing my employer, RDA Corporation, at the Philly .NET user group. My presentation, titled 'Visual Studio 2005 Tips and Treats', was a huge success. I was amazed at the 'wows' I heard coming from the audience. People really seemed to enjoy learning cool new tricks that they can apply immediately. The audience themselves were fantastic too – it was a very conversational presentation. I was even taught a few new tricks which I will incorporate into the e-Book when I get a chance.

    As promised, you can download the draft of the e-Book here. Included in the Bonus folder are the Visual Studio 2005 Automation Object Model chart, and the VB and C# keyboard mapping posters. I will make the sample add-in available at a later date once I work out a few bugs, and make it more deployment friendly. Note, it is just a draft. I was weighing between finishing it, or letting you peruse through it and letting me update it as we go. I chose the latter.

    Thanks again! Philly.NET rocks!

  • Thanks CMAP!

    On Saturday, I had the privilege of presenting at the Central Maryland Association of .NET Professional's Code Camp in Columbia, MD. Chris Steen did a fantastic job of organizing the event, and I had a blast! I was amazed at how well my topic of discussion, 'Visual Studio 2005 Tips and Treats', was received. I have received no less than three emails so far asking for the slides/code/etc. Don't worry, I haven't forgotten. As a side note, I'm the same way. I hate it when a presenter says they will post something, and then never does.

    Update (10/18/2007 12:34am) – The draft of the e-Book is now published on my site. You can download the stuff here.

    I made mention in the session that I would be posting the tips on my blog on Wednesday. However, given the demand, I will try to get them up sooner. I'm trying to clean them up a bit – they were a rough outline for me to follow while presenting. So far, the document is 17 pages. Watch this post for the final document including bonus content I didn't have time to cover during the session, as well as the Microsoft Keyboard Shortcuts posters and the Visual Studio Object Model chart.

    Here's a quick teaser tip:

    Temporary Projects (Throwaway, Zero-Impact)
    Temporary projects are great for quick tests, or as a Snippet Compiler replacement. Essentially, this allow you to create a single project without saving it. When you close the project, you are prompted to save or discard the project. To enable this feature, go to Tools | Options | Projects and Solutions. Uncheck the box for 'Save new projects when created.'

    Do you have a tip or trick I didn't mention? Send it along, and I'll add it to the list. Have questions about the tips or tricks, or Visual Studio how-tos? Feel free to contact me and I'll try to help you out.

    Again, thanks to everyone who came out to my session. Hope to see most of you again soon <g>.

  • For Immediate Distribution: I’m a D.A.D.!

    I just passed the 70-529 Distributed Application Development exam. Man, this was the hardest one yet.

    Anyway, I am stoked, and I learned about some really amazing .NET technologies – WSE, .NET Messaging and .NET Remoting (which is NOT dead, by the way).

    As an aside: if you thought I was zealous before… Now there really is no reason not to rewrite or re-engineer that humongous enterprise financial application. (I say 2-3 years and $3-4 million – make it up with the first sale or two)

Powered by Community Server (Commercial Edition), by Telligent Systems
© Platinum Bay | Some Rights Reserved Creative Commons License

Disclaimer: The information in this weblog is provided "AS IS" with no warranties, and confers no rights. This weblog does not represent the thoughts, intentions, plans or strategies of my employer. It is solely my opinion. Feel free to challenge me, disagree with me, or tell me I'm completely nuts in the comments section of each blog entry, but I reserve the right to delete any comment for any reason whatsoever (abusive, profane, rude, or annonymous comments) - so keep it polite, please.