Ever Accidentally Kicked Off a Build in VS?

If you've ever kicked off a way long build on accident in Visual Studio, I'm sure you've considered doing an End Task on it (or perhaps something far more drastic and rash).  Well, there is a keyboard shortcut that will cancel the current build in progress.  Just hit Ctrl+Break, and hand me the sledgehammer before you do something you regret.  Computers are your friend.  Repeat after me...

View Full Article

Some Pending Microsoft Technologies

A cool new technology Microsoft is working on in its Live Labs is called Volta.  It is a way to develop web applications all in one tier, and then late in the development process decide which parts of the code should be client-side and which parts should be server side.  The idea is that you can easily move code fragments back and forth between client-side and server-side at will.  You write your web application in any language of your choice that compiles to .NET and Volta will turn it completely and solely into HTML and JavaScript, meaning your resulting site will be compatible with any browser.  And your site can have all of this with an AJAX look-and-feel.  Check it out here:  http://labs.live.com/volta/

A different Microsoft team is working on a download called ASP.NET 3.5 Extensions (http://www.asp.net/downloads/3.5-extensions/).  It is in "public preview" right now.  It contains some new additions to ASP.NET AJAX, some new Silverlight controls, and a few other cool additions.  Most interesting to me is an MVC Framework  (Model-View-Controller).  One of the managers has a blog that I frequent, and he has written a 5-part series of blogs about this new framework.  This link will send you directly to Part 1 (skipping Part 0):  http://weblogs.asp.net/scottgu/archive/2007/11/13/asp-net-mvc-framework-part-1.aspx

Also, it appears Microsoft recently released a training kit for Visual Studio 2008 and .NET Framework 3.5 available for download now at the following location:  http://www.microsoft.com/downloads/details.aspx?FamilyID=8bdaa836-0bba-4393-94db-6c3c4a0c98a1&DisplayLang=en

Enjoy.

View Full Article

Registry Launch Condition in VS 2005 Deployment Project

I have a Visual Studio 2005 deployment project where I wanted to add a launch condition that would check the registry for a key before continuing.  This article is really straight forward about how to do that:  http://msdn2.microsoft.com/en-us/library/4awx1f1d(VS.80).aspx

However, every time I put the registry path in, it would never find the key upon install.  So the key was located at something like HKLM\SOFTWARE\MyCompany\MyProduct and then there was a Value named Target Path that I wanted to check if it existed.  My understanding (and perhaps I'm wrong) that keys are keys but the values are keys also (at least it seems that way when doing registry stuff through the .NET APIs in C#).  So when I saw the following statement in the above article, I thought the property was for testing the value of a Value (AKA key?):

"Optionally, set the Value property to search for a specific value in the registry key."

Essentially I tried to append the Value to the RegKey path, because I thought the Value property was only for testing the value of the Value.  If you want to test the value of the Value, you do it in the Condition property of the Property created by the registry launch condition.  Is that as clear as mud?

This article is what cleared up my confusion (the 2nd post, the one by Phil Wilson):  http://www.dotnet247.com/247reference/msgs/49/246890.aspx

I realized that a registry Value should not be part of the RegKey path.

View Full Article

LINQ Tutorial

So I'm really excited to start using Visual Studio 2008 and LINQ.  A few of the guys here at work are learning it and will hopefully be giving us a little presentation in the next few weeks about how they used it in one of our projects.  They have been learning it with the help of the following tutorial, which I hope to read through in the next few days:  http://weblogs.asp.net/scottgu/archive/2007/05/19/using-linq-to-sql-part-1.aspx

By the way, it's a 9-part series of blog posts (if you care to get that into it).

View Full Article

Windows Forms UI Threading

I fixed a UI issue we were having where some work was being done and it was updating a progress bar, but it wasn't correctly painting the rest of the labels and other static UI elements.  It's best to let the UI do it's thing on the main thread, and then spawn off a worker thread in the background, allowing them to communicate with each other through delegates.

Here is a very nicely done, informative article about delegates that I should have read (I probably would have gotten to my solution quicker and surpassed my trial and error issues):  http://www.ondotnet.com/pub/a/dotnet/2002/11/04/delegates.htm

I used the following two articles as a basis for my fix:

However, I didn't end up using the MulticastDelegate class at all in my solution.  It's not really necessary, and I couldn't get it to work when I tried to extend or inherit from it.  The following article says you can't anyway, unless you are a compiler or some similar tool:  http://msdn2.microsoft.com/en-us/library/system.multicastdelegate.aspx

This link has a cool helper class for asynchronous delegates, though I didn't use it:  http://peach.ease.lsoft.com/scripts/wa.exe?A2=ind0302B&L=ADVANCED-DOTNET&T=0&F=&S=&P=31992

Good luck.

FOLLOWUP (05/21/09)I have some further clarifications about how to properly invoke delegates to a new background thread in this post:

BeginInvoke Methods and OneWay Attribute

View Full Article