2 April 2010 0 Comments

Announcing the Tips and Tricks SWAG Fest Beginning April 12th

  So, someone thought it would be a good idea to give me some money for SWAG to give to my readers.  Naturally, I loved the idea!  So I went and bought a whole bunch of $100 ThinkGeek gift certificates.  The problem is how to give them away?  After much thought (about 10 minutes, at least), I figured the best way was to give them away whenever I felt like it.    Okay so there you have it.  Beginning April 12th (Visual Studio 2010 Launch Day) I will be giving away ThinkGeek gift certificates.  I’ll be picking people who show love for the Visual Studio Tips and Tricks blog.  There are some basic ways you can do this:   Leave some cool comments on the tip(s) you like the most Tweet about the Tips blog using the #vstips hashtag Show some blog love by cross posting to your blog if you have one Feel free to get creative and let me know about it.  That’s pretty much it.  Very simple really.  Look for the fun to begin on Launch Day.

8 March 2010 0 Comments

How to Create a Powershell 2.0 Module and Cmdlet with Visual Studio 2010 (Screencast included)

This is one of those tasks I need to repeat every now and then and always forget the exact steps. So in the interest of sharing, I’ve written this post to demonstrate how to get started building a very simple module and cmdlet with C# and Visual Studio.

7 February 2010 0 Comments

How to: Create Interfaces with Static Methods via IL?

If you try to add a static member to an interface, you will get the following error: The modifier ‘static’ is not valid for this item In this case, you should create an abstract class instead of an interface, because interfaces are contracts and should not implement any methods. However, it’s still possible to do so using IL. The error above was produced because of the following rule in the CLI spec : “CLS Rule 19: CLS-compliant interfaces shall not define static methods, nor shall they define fields….( read more )

28 January 2010 0 Comments

How to: Debug Deadlocks Using Windbg?

Attach the debugger to the process Load SOS ~* e !clrstack to view the CLR stack of all the threads and where they are Look for System.Threading.Monitor.Enter(System.Object) in the top frames Load SOSEX.dll from http://www.stevestechspot.com/SOSEXUpdatedV11Available.aspx !dlk to detect deadlocks. The output looks like the following: Deadlock detected: CLR thread 5 holds sync block 0018f05c OBJ:010d909c[Microsoft.Sample.SampleEvent]             …( read more )

3 August 2009 0 Comments

One More Sparkline Trick

In this blog post I’ll walk through one more interesting way you can use sparklines in Excel 2010. In the above example we have the sales for each book category and for each store.  While you can’t see the exact numbers in this view, you can get the feel for which sections sell well at the different stores.  Let’s see how this is made with sparklines in Excel: There are actually 24 sparklines in the picture above; each one is bound to a single data point in a similar table with the numbers.  You can create this in one swoop with the Insert Sparkline dialog by selecting the rectangle of cells for the location, and then select all of the sales numbers as the data source.  This isn’t really an intended use for sparklines since each one only has a single data point, but it’s an interesting visual that could be useful with some more context in a report or dashboard