Mike Parks

"If you want to be the best, you've got to work with the best"
posts - 26, comments - 101, trackbacks - 0

My Links

News

Archives

Monday, November 07, 2011

SQL Server Denali CTP 3 - Dockable Windows!

The future of SQL Server Management Studio looks pretty promising.

I downloaded SQL Server Denali CTP 3 the other day and was really happy to see that they've finally implemented dockable windows. I always find myself trying to drag the tabs out of SSMS 2008 to my 2nd monitor. Check it out if you get the chance. Just wanted to spread the word.

  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Posted On Monday, November 07, 2011 9:27 PM | Feedback (0) |

Saturday, June 18, 2011

A little SQL tip for C# developers

The other day at work I came across a handy little block of SQL code from Jeremiah Clark's blog. It's pretty simple logic but through the mind of a C# developer making some quick DB updates, seems to me that it's more likely to end up writing out the code in Solution 1 instead of Solution 2 below to solve the problem.

Basically, I needed to check and see if a specific record existed in Table1. If it does exist, then update that record, otherwise insert a new record into Table1.


Solution 1:
IF EXISTS (SELECT * FROM Table1 WHERE Column1='SomeValue')
    UPDATE Table1 SET (...) WHERE Column1='SomeValue'
ELSE
    INSERT INTO Table1 VALUES (...)


Solution 2:
UPDATE Table1 SET (...) WHERE Column1='SomeValue'
IF @@ROWCOUNT=0
    INSERT INTO Table1 VALUES (...)
   
   
As Jeremiah explains, they both accomplish the same thing but from a performance standpoint, Solution 2 is the better way to go (saved table/index scan). Just wanted to throw this small tip out there. Thanks!

- Mike

  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Posted On Saturday, June 18, 2011 1:46 AM | Feedback (2) |

Monday, April 11, 2011

Search Work Items for TFS 2010 Source Code Published on CodePlex

A little while back we published the Search Work Items for TFS 2010 extension in the Visual Studio Gallery. Noah Coad recently added Cory and I as Developers on the existing Search Work Items CodePlex project. Over the weekend I uploaded the new source code containing our Visual Studio and TFS 2010 updates. Feel free to check out the source code.

You can run the code locally but just be sure you have the Visual Studio 2010 SDK installed and you are pointing at your experimental instance of Visual Studio. To do this, just right click on the project in the Solution Explorer, click properties, click the Debug tab, then set the following properties:

Start external program: C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\devenv.exe
Command line arguments: /rootsuffix Exp


Here's the link to the source code:
http://searchworkitems.codeplex.com/SourceControl/list/changesets



We're planning on publishing the source code to all our other extensions soon once we get some spare time. I'll post another blog once they're out there.

- Mike

  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Posted On Monday, April 11, 2011 7:09 PM | Feedback (0) |

Thursday, October 28, 2010

Some handy tools - Copy As Path / Send To Toys

So I was reading through Cameron Skinners blog the other day and came across his post about the "Copy As Path" context menu option in Windows Explorer. Turns out this menu option is hidden unless you right click on a file while holding the shift key. It also turns out that this feature has been around for a while and I'm just now catching up :)


 

I thought this was pretty cool when I first found it but then I realized it always copied the path and wrappped it with quotes (Ex: "C:\Test.txt") I can understand why the quotes can be needed since paths can contain spaces but the quotes as a wrapper really should be an option. I couldn't find a way to disable this but after some quick googling I came across Gabriele Ponti's "Send To Toys". This tool simply adds extra context menu options to the Send To menu (one of them being "Clipboard (as name)"). In the config settings for this app, you can specify whether you want quotes or not. There's a few other cool send to options in there too. I had to download the 64 bit beta version since the 32 bit wasn't cooperating with my OS. This tool is probably not something that you'll be constantly using but it's always nice to have these small tools ready when you actually do need them. Check it out if you haven't already heard of it.


  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Posted On Thursday, October 28, 2010 8:41 PM | Feedback (0) |

Monday, September 27, 2010

Our Visual Studio Extensions hit over 20,000 downloads!

A few months ago Visual Studio 2010 RTM was released. My friend Cory and I noticed a few features that would really come in handy but were not included in the release. After learning how to write extensions, we decided to create a few of our own. We used all of them locally for a while. Around April/May we decided to publish them to the Visual Studio Gallery so they can help other developers as well. Overall, I'm pretty satisfied with the outcome. We got a lot of good feedback on them and it seems like we've helped a lot of people. It's always nice seeing those 5 star reviews come in! The total download count for our 8 extensions as of now is 21,321! Obviously, I set my expectations too low on these projects because I figured the cumulative count would max out around 10k. Thanks to all that downloaded our extensions! If you haven't downloaded them, feel free to check them out and drop us a review on the VIsual Studio Gallery!

Here's the link to our extensions on the Visual Studio Gallery: http://visualstudiogallery.msdn.microsoft.com/en-us/site/search?f[0].Type=SearchText&f[0].Value=mike+parks&x=0&y=0

  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Posted On Monday, September 27, 2010 9:04 PM | Feedback (0) |

Thursday, July 22, 2010

Go download the Visual Studio 2010 Productivity Power Tools!

If you're using Visual Studio 2010 as your IDE I'm sure you've heard that Microsoft just released an update to their Productivity Power Tools extension a couple days ago. If you haven't installed this yet, go do it now! It's packed with tools that will help you when programming in VS 2010. The best tool out of the set is called Solution Navigator. It's basically a beefed up version of the Solution Explorer. I'm not going to go into too much details here but I just wanted to provide the links below to get the word out there and spread the knowledge. The Productivity Power Tools already have 82,096 total downloads last time I looked. Well, go check it out! :)

Visual Studio Blog (update released): http://blogs.msdn.com/b/visualstudio/archive/2010/07/18/new-version-of-the-productivity-power-tools-is-available.aspx
Visual Studio Blog (info on Solution Navigator): http://blogs.msdn.com/b/visualstudio/archive/2010/07/20/solution-navigator-blog-post.aspx
Download Link: http://visualstudiogallery.msdn.microsoft.com/en-us/d0d33361-18e2-46c0-8ff2-4adea1e34fef

 

  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Posted On Thursday, July 22, 2010 11:03 PM | Feedback (0) |

Monday, July 05, 2010

WCF & WPF Peer Channel Chat

A few days ago I was reading up on some WCF technology called Peer Channel. It looked pretty cool so I decided to try it out. I was pretty shocked to find out how easy it was to build a chat messaging service using this this stuff. I was able to run a chat client on my computer, a chat client on my friends computer, and the WCF Chat service on a server. We were able to send messages back and forth to each other (all on the same network of course). It worked pretty fast without using a lot of resouces on either computer or over the network. I threw a WPF interface on it to look nice, which was really easy to do as well. I just wanted to post up some of the code here on my blog in case anyone wanted to see how it works.

Client 1 and Client 2:

 Service that runs on the server:

 

 Only needed a few files to make it work:

 Here's the code to the important files:

PeerChannel – Client – App.config

 

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
 
  <system.serviceModel>
 
    <client>
      <!-- chat instance participating in the mesh -->
      <endpoint name="ChatEndpoint" address="net.p2p://chatMesh/MyChatServer/Chat" binding="netPeerTcpBinding" bindingConfiguration="BindingCustomResolver" contract="MyChat.IChat">
      </endpoint>
 
    </client>
 
    <bindings>
      <netPeerTcpBinding>
        <!-- Refer to Peer channel security samples on how to configure netPeerTcpBinding for security -->
        <binding name="BindingCustomResolver" port="0">
          <security mode="None"/>
          <resolver mode="Custom">
            <custom address="net.tcp://SERVERNAMEGOESHERE/MyChatServer/peerResolverService" binding="netTcpBinding" bindingConfiguration="Binding3"/>
          </resolver>
        </binding>
      </netPeerTcpBinding>
 
      <netTcpBinding>
        <!-- You can change security mode to enable security -->
        <binding name="Binding3">
          <security mode="None"/>
        </binding>
      </netTcpBinding>
    </bindings>
 
  </system.serviceModel>
  
</configuration>

 

PeerChannel – Client – ChatClient.xaml.cs

 

using System;
using System.DirectoryServices;
using System.Security.Principal;
using System.Windows;
using System.Windows.Input;
 
namespace MyChat
{
    public partial class ChatClient : Window
    {
        PeerChat chat;
 
        public ChatClient()
        {
            InitializeComponent();
        }
 
        private void btnJoin_Click(object sender, RoutedEventArgs e)
        {
            if (!String.IsNullOrEmpty(txtName.Text))
            {
                chat = new PeerChat(txtName.Text);
                chat.OnChatOnline += new PeerChat.ChatOnline(chat_OnChatOnline);
                chat.OnChatOffline += new PeerChat.ChatOffline(chat_OnChatOffline);
                chat.OnJoin += new PeerChat.JoinChat(chat_OnJoin);
                chat.OnLeave += new PeerChat.LeaveChat(chat_OnLeave);
                chat.OnChat += new PeerChat.ChatSendReceive(chat_OnChat);
                string result = chat.Start();
                txtChat.Text += result;
            }
        }
 
        void chat_OnChat(string member, string msg)
        {
            txtChat.Text += String.Format("[{0}] {1}" + Environment.NewLine, member, msg);
            txtChat.ScrollToEnd();
        }
 
        void chat_OnLeave(string member)
        {
            txtChat.Text += String.Format("[{0} left]" + Environment.NewLine, member);
        }
 
        void chat_OnJoin(string member)
        {
            txtChat.Text += String.Format("[{0} joined]" + Environment.NewLine, member);
            btnSend.IsEnabled = true;
        }
 
        void chat_OnChatOffline(object sender, EventArgs e)
        {
            txtChat.Text += String.Format("**  Offline" + Environment.NewLine);
        }
 
        void chat_OnChatOnline(object sender, EventArgs e)
        {
            txtChat.Text += String.Format("**  Online" + Environment.NewLine);
        }
 
        private void btnSend_Click(object sender, RoutedEventArgs e)
        {
            chat.SendMessage(txtMessage.Text);
            txtMessage.Text = String.Empty;
        }
 
        private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e)
        {
            if (chat != null)
                chat.End();
        }
 
        private void txtMessage_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.Key == Key.Enter)
            {
                chat.SendMessage(txtMessage.Text);
                txtMessage.Text = String.Empty;
            }
        }
    }
}
 

PeerChannel – Client – PeerChat.cs

 

using System;
using System.ServiceModel;
 
namespace MyChat
{
    [ServiceContract(Namespace = "MyChat", CallbackContract = typeof(IChat))]
    public interface IChat
    {
        [OperationContract(IsOneWay = true)]
        void Join(string member);
 
        [OperationContract(IsOneWay = true)]
        void Chat(string member, string msg);
 
        [OperationContract(IsOneWay = true)]
        void Leave(string member);
    }
 
    public interface IChatChannel : IChatIClientChannel
    {
    }
 
    public class PeerChat : IChat
    {
        private bool IsConnected { getset; }
 
        string member;
        IChatChannel participant;
        DuplexChannelFactory<IChatChannel> factory;
        public delegate void JoinChat(string member);
        public delegate void ChatSendReceive(string member, string msg);
        public delegate void LeaveChat(string member);
        public delegate void ChatOnline(object sender, EventArgs e);
        public delegate void ChatOffline(object sender, EventArgs e);
        public event JoinChat OnJoin;
        public event ChatSendReceive OnChat;
        public event LeaveChat OnLeave;
        public event ChatOnline OnChatOnline;
        public event ChatOffline OnChatOffline;
 
        public PeerChat(string member)
        {
            this.member = member;
        }
 
        public string Start()
        {
            string result = String.Empty;
            InstanceContext instanceContext = new InstanceContext(this);
            factory = new DuplexChannelFactory<IChatChannel>(instanceContext, "ChatEndpoint");
            participant = factory.CreateChannel();
 
            IOnlineStatus ostat = participant.GetProperty<IOnlineStatus>();
            ostat.Online += new EventHandler(OnOnline);
            ostat.Offline += new EventHandler(OnOffline);
 
            try
            {
                participant.Open();
                IsConnected = true;
            }
            catch (CommunicationException)
            {
                result += "Could not find resolver." + Environment.NewLine +
                    "Please make sure the Chat Server is running before using this chat client." + Environment.NewLine +
                    "Refer to the readme for more details." + Environment.NewLine;
 
                IsConnected = false;
                return result;
            }
 
            participant.Join(member);
            return result;
        }
 
        public void SendMessage(string message)
        {
            participant.Chat(member, message);
        }
 
        public void End()
        {
            try
            {
                if (IsConnected)
                {
                    if (participant != null)
                    {
                        participant.Leave(member);
                        participant.Close();
                        participant.Dispose();
                    }
 
                    if (factory != null)
                    {
                        factory.Close();
                    }
                }
 
                IsConnected = false;
            }
            catch (Exception)
            {
            }
        }
 
        public void Join(string member)
        {
            if (OnJoin != null)
                OnJoin(member);
        }
 
        public void Chat(string member, string msg)
        {
            if (OnChat != null)
                OnChat(member, msg);
        }
 
        public void Leave(string member)
        {
            if (OnLeave != null)
                OnLeave(member);
        }
 
        public void OnOnline(object sender, EventArgs e)
        {
            if (OnChatOnline != null)
                OnChatOnline(member, e);
        }
 
        public void OnOffline(object sender, EventArgs e)
        {
            if (OnChatOffline != null)
                OnChatOffline(member, e);
        }
    }
}

 

PeerChannel – WCF Service Console – App.config

 

<?xml version="1.0"?>
<configuration>
  <system.serviceModel>
    <services>
      <service name="System.ServiceModel.PeerResolvers.CustomPeerResolverService">
       <host>
          <baseAddresses>
             <add baseAddress="net.tcp://SERVERNAMEGOESHERE/MyChatServer/peerResolverService"/>
          </baseAddresses>
       </host>
        <!-- use base address provided by the host -->
            <endpoint address="net.tcp://SERVERNAMEGOESHERE/MyChatServer/peerResolverService" binding="netTcpBinding" bindingConfiguration="Binding1" contract="System.ServiceModel.PeerResolvers.IPeerResolverContract"/>
      </service>
    </services>
    <bindings>
       <netTcpBinding>
          <!-- You can change security mode to enable security -->
          <binding name="Binding1">
              <security mode="None"/>
          </binding>
       </netTcpBinding>
    </bindings>
  </system.serviceModel>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup></configuration>

 

PeerChannel – WCF Service Console – DefaultCustomResolver.cs

 

using System;
using System.ServiceModel;
using System.ServiceModel.PeerResolvers;
 
namespace MyChatServer
{
    class DefaultCustomResolver
    {
        public static void Main()
        {
            // Create a new resolver service
            CustomPeerResolverService crs = new CustomPeerResolverService();
            crs.ControlShape = false;
 
            // Create a new service host
            ServiceHost customResolver = new ServiceHost(crs);
 
            // Open the resolver service 
            crs.Open();
            customResolver.Open();
            Console.WriteLine("Custom resolver service is started");
            Console.WriteLine("Press <ENTER> to terminate service");
            Console.ReadLine();
        }
    }
}

 

  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Posted On Monday, July 05, 2010 6:27 PM | Feedback (0) |

Tuesday, May 25, 2010

Work Item Visualizer for TFS 2010 - New Extension

I released another new extension to the Visual Studio Gallery again today called Work Item Visualizer for TFS 2010. I've only heard positive things about it so far, hopefully it stays that way :) Basically, it creates a diagram of all work items linked to a work item ID which the user specifies in a search box. This extension was coded using DGML (the same graph rendering language used for the Visual Studio 2010 Architecture Tools). It was pretty cool getting a chance to create something using some of the newest technology out there. Well, I just wanted to throw a blog up to get the word out on it a little more. If you're using Visual Studio 2010 with Team Foundation Server 2010, feel free to check it out! Thanks everyone.

Download Link: http://visualstudiogallery.msdn.microsoft.com/en-us/a35b6010-750b-47f6-a7a5-41f0fa7294d2

 

What it does:

·         Creates a DGML graph to visualize linked TFS Work Items by entering a Work Item ID in the toolbar search box

 

How it benefits you:

·         Allows you to easily analyze the hierarchy of your TFS Work Items

·         Gain the ability to perform basic risk/impact analysis when creating or editing Work Items

·         Great for meetings in the case that you need to discuss the entire scope of linked Work Items

·         Easier project planning

·         Eliminates the need to create TFS queries or reports to view tree of Work Items

·         Easily lets you see the entire tree of work items linked to the one you’re working on

 

Navigation Tips:

·         Use Ctrl + Mouse Wheel Scroll to zoom in and out

·         Use Ctrl + Left Mouse click (and hold) to move document around

·         Right click on DGML area for more options (Like copy image or viewing in groups)

·         Clicking on each node highlights that node and the links connected to it

·         Colors in the legend can be changed

·         When work item nodes are deleted, the view is automatically updated

·         Double clicking on work item node will open up the Work Items URL

 

Try it out on work items that have several of links and let us know what you think. A big thanks goes out to everyone working on the http://visualization.codeplex.com/ project for publishing the source code on CodePlex which really helped me learn how DGML (Directed Graph Markup Language - New to Visual Studio 2010 Architecture Tools) works!

 

 - Mike

  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Posted On Tuesday, May 25, 2010 10:54 PM | Feedback (22) |

Thursday, May 20, 2010

Search Work Items for TFS 2010 - New Extension

A few months ago I was constantly using Visual Studio 2008 with Team Foundation Server 2008. Searching for work items with queries inside Visual Studio became a pain until I found an add in that simplified it into one little search box in the IDE.  It allowed me to enter some text in, hit the enter key, and it would bring back a list (aka open a .wiq file) of work items that matched the text entered. I became a huge fan of Noah Coad's Search Work Item Add In. He wrote a pretty good blog on how to use it as well.

Of course when we upgraded to Visual Studio 2010 and Team Foundation Server 2010, the 2008 add in no longer worked. I didn't see any updates for it on codeplex to be 2010 compatible. Cory Cissell and I have published a few Visual Studio Extensions already so I figured I'd take a shot at making this tool 2010 compatible by turning it into an extension. Sure enough, it worked. We used it locally for a while and recently decided to publish it to the Visual Studio Gallery.

If you are currently looking for an easy way to search work items in Visual Studio 2010, this is worth checking out. Big thanks goes out to Noah for originally creating this on codeplex.

The extension we created can be downloaded here: http://visualstudiogallery.msdn.microsoft.com/en-us/3f31bfff-5ecb-4e05-8356-04815851b8e7

 

 

 * Additional note: The default search fields are Title, History, and Description. If you want to modify which work item fields are searchable, type in "--template" (no quotes) into the search box and hit enter. This will open the search template. Just add another "Or" statement, pick the field name, select an operator, type "[search]" (no quotes) in the value field, and hit ctrl + s to save. The next time you run a search it will use the modified search template.

That's all for now. Thanks!

- Mike

  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Posted On Thursday, May 20, 2010 11:43 PM | Feedback (30) |

New Bing Maps

Normally I don't stray too far from Programming and TFS on my blog posts but I'm just really impressed with how much Silverlight has improved Bing maps. I use to be big on MapQuest, then hopped over to Google, but now the new Bing Maps have everything I need.

The two coolest features are right on the main page. All you have to do is go to http://www.bing.com/maps/explore/, enter your city and hit enter in the search box, then look in the lower left corner under the EXPLORE section. Check out the "What's nearby" and "Restaurants" links. The best part is, if you're interested in doing any Silverlight programming, they have a Bing Maps Silverlight Control Interactive SDK. I was thinking about coding something....but they've pretty much got it down :) Pretty impressive stuff.

 

 

 

  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Posted On Thursday, May 20, 2010 10:52 PM | Feedback (0) |

Wednesday, May 12, 2010

TFS 2010 Auto Shelve Extension

We've been working with the Visual Studio 2010 SDK and the TFS 2010 SDK a lot recently to create new Visual Studio Extensions. You can find these extensions in the Visual Studio Gallery. If you're a developer/programmer, you should check it out, they have some pretty cool tools out there. I'd be surprised if you told me you went there and couldn't find any tools that could help you.

One of the new extensions Cory and I made is called TFS Auto Shelve. Check out the description and read about it below. If you're interested and you have VS 2010 w/TFS 2010, feel free to try it out and let us know what you think.

You can download it here: http://visualstudiogallery.msdn.microsoft.com/en-us/080540cb-e35f-4651-b71c-86c73e4a633d

 

Here's a description and screenshots:

Protect your code by guaranteeing your pending changes are always backed up to the TFS server.

 What it does:

  • Automatic Shelving shelves all your pending changes while you are coding
  • Manual Shelving shelves all your pending changes anytime with a single menu click or Ctrl+T hotkey
  • Uses one shelveset per workspace to shelve all pending changes to the TFS Server
  • Shelvesets are re-used to save the latest version of pending changes

 Functionality:

  • Automatic Shelving
    • Begins when any solution mapped to TFS is opened in Visual Studio
    • Disabled when non-mapped TFS solution is opened
    • Team Menu allows you to turn on/off automatic shelving
      • Team Menu -> TFS Auto Shelve (Running)
      • Team Menu -> TFS Auto Shelve (Not Running)
  • Manual Shelving
    • Can be triggered any time as long as you are connected to TFS
      • Team Menu -> TFS Auto Shelve Now
  • Options
    • Tools Menu -> Options -> TFS Auto Shelve Options
      • BaseName – This name is automatically followed by the workspace name to create a unique shelveset name. By default it’s “TFS Auto Shelve”.
      • TimerSaveInterval – The interval (in minutes) which automatic shelving will occur

 Helpful Info:

  • To view shelvesets, open Source Control Explorer, click on:
    • File > Source Control > Unshelve Pending Changes
  • Workspaces can be modified by:
    • Opening the Source Control Explorer > Clicking on Workspaces drop down > Click Workspaces… > Click Add/Edit/Removed
  • Custom Visual Studio Activity Logging is implemented. If you run into any errors, please startup Visual Studio with the /log switch, re-create the error, then close Visual Studio. You can browse to “%AppData%\Microsoft\VisualStudio\10.0\ActivityLog.XML” to view the log. Please feel free to inform us of any errors you see and we can work it out via email.

 

Thanks!

- Mike

  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Posted On Wednesday, May 12, 2010 6:22 PM | Feedback (20) |

Visual Studio 2010 - Faster Startup with /nosplash

I read a blog the other day about the /nosplash switch in Visual Studio. Apparently, it's been around a while and I'm a little late on finding out about it. I figured I'd share it for those of you that come across this and didn't know about it as well. Basically all it does is turn off the Visual Studio splash screen which speeds up initial startup time. It's not a big difference but every little bit helps. I choose speed over looks. You can set the switch by right clicking on Visual Studio, selecting Properties, and adding "/nosplash" on the target Property, so it will look like this: "C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\devenv.exe" /nosplash.

Feel free to try it out and see if you like it. You can always change it back by just removing the /nosplash switch when you're done testing. There are plenty more Visual Studio switches out there but this is the main one that came in handy for me.

 

- Mike

  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Posted On Wednesday, May 12, 2010 5:51 PM | Feedback (1) |

Thursday, May 06, 2010

Visual Studio 2010 Modeling and Architecture Tools

Jennifer Marsman (Microsoft Evangelist) and Cameron Skinner (Microsoft Visual Studio Product Unit Manager) recently stopped by our office while they were passing through Louisville on their tour to give us a presentation on the new Visual Studio 2010 Modeling and Architecture Tools.

I checked out these new features when Visual Studio 2010 Beta versions originally rolled out and have been really impressed with this stuff ever since then. So it was pretty cool to actually learn some new techniques from Cameron himself since he helped write the actual code behind some of those features. If you've upgraded to Visual Studio 2010 recently I would highly recommend using the Architecture tools. They're awesome. If you want to make improvements to it, they even have their own SDK for it. There are plenty of blogs out there to show you how to use it. I've been waiting to find a tool that works like this where I can really analyze the code in solutions and projects and see how everything ties together.

It's really handy if you're asked to work on a new project and aren't familiar with how it works. Just run the tools, analyze the DLL's, learn how everything works, and then you'll be ready to implement new code! It's a great tool to learn new systems quick and easy and it's all housed within the Visual Studio IDE. I just wanted to write a blog to brag about it a little bit, so I figured I'd throw this up here. It's a must have tool for Developers/Architects. Here's some screenshots of when I was using it earlier:

 

Thanks everyone!

- Mike

  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Posted On Thursday, May 06, 2010 11:31 PM | Feedback (0) |

Tuesday, April 20, 2010

New Visual Studio 2010 Extension - Collapse Solution

If your team has recently upgraded to Visual Studio 2010, take a second to check out the new Extension Manager. You can use it to browse through or install tons of tools, controls, or templates from the Visual Studio Gallery.

My friend, Cory Cissell, and I recently teamed up and created an extension of our own called "Collapse Solution". It adds an option called Collapse Solution to the context menu of the solution node in the solution explorer. It also adds an option called Collapse Project to the context menu of each project node in the solution explorer. When that option is clicked, it will walk through the solution explorer tree and collapse any expanded child nodes in that section (projects, folders, code behind files, designer files, etc.). I use to have an add-in that did this in Visual Studio 2008 but it wasn't compatible when we upgraded to 2010 so we decided to write our own. The old tool was also packaged with a bunch of other junk that we didn't need so we figured it would be a much cleaner tool if it was broken off into its own extension. There's no need to install extra tools if you don't really need them.

So if you have upgraded to Visual Studio 2010, please feel free to try out our Collapse Solution extension and leave us a rating/review in the Visual Studio Gallery. Thanks!

Here's the link: http://visualstudiogallery.msdn.microsoft.com/en-us/2d81fec6-71f3-4fa5-87b4-c2aa18e42f92

- Mike

 

  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Posted On Tuesday, April 20, 2010 10:12 PM | Feedback (9) |

Thursday, October 29, 2009

Visual Studio 2010 Beta 2!

We recently had Stephen Toub, a Senior Program Manager on the Parallel Computing Platform team at Microsoft, swing by our office and walked us through some really cool ways to start implementing parallel programming using Visual Studio 2010 and the 4.0 Framework. I'm thankful that I had the opportunity to attend this, it was one of the best presentations I've ever seen. It's exciting to see the technology evolving :)

Anyway, during his presentation we caught a lot of Visual Studio 2010 Beta 2 in action. There's a bunch of cool improvements and everything seems a lot faster and more responsive. TFS 2010 is also available for download on Microsoft's web site. The links have been changing around since it's been released but here's where it's all currently at:

http://msdn.microsoft.com/en-us/vstudio/dd582936.aspx

Check it out!



- mike
  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Posted On Thursday, October 29, 2009 11:43 PM | Feedback (1) |

Wednesday, September 16, 2009

TFS - View all pending changes for all users

Team Foundation Server allows you to see who has what file checked out at any time.  If you would like to see a list of files that any TFS User has checked out, follow the steps below:

  1. Open Visual Studio 2008 > Click File > Source Control > Find In Source Control > Status
  2. Select "Display all checked out" or "Display files checked out to" (to filter changes by user)
  3. Hit Find
The screenshots below show the type of results you should expect.  Another great way to get this info is by using Team Foundation Sidekicks. If you go this route, you will be able to export the results to a spreadsheet to make them easier to work with. I had to use this the other day to generate a list of all files that were checked out by multiple users. It was easy to work with the data once I got it in Excel.  If you prefer getting these results from the command line, you can use the tf status command in the Visual Studio 2008 command prompt as another option to view pending changes by TFS Users.







  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Posted On Wednesday, September 16, 2009 9:13 PM | Feedback (3) |

TFS - Undelete File or Folder

If you ever need to undelete a file/folder in TFS, here's how you can do it. I found a couple of people who didn't know this feature existed so I figured I'd throw a blog up about it.
  1. Open Visual Studio > Click Tools > Options > Source Control > Visual Studio Team Foundation Server
  2. Check Show deleted items in the Source Control Explorer, hit OK
  3. Right click on deleted file/folder in Source Control Explorer
  4. Click Undelete
  5. Check In


  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Posted On Wednesday, September 16, 2009 8:45 PM | Feedback (2) |

Tuesday, September 15, 2009

TFS Auto Shelving

 


For Visual Studio 2010 / TFS 2010 please see:  http://geekswithblogs.net/MikeParks/archive/2010/05/12/tfs-auto-shelve---new-visual-studio-2010--tfs.aspx


In one of our meetings the other day a few developers on our team asked if there was an Auto Shelve feature in TFS to shelve their pending changes automatically each night. I couldn't find anything in the Visual Studio 2008 IDE that allowed us to do this.  After some research, I did find a work around.

Basically, I just created a batch file that uses the Visual Studio 2008 Command Prompt to run tf shelve on the highest level folder of your local TFS workspace mapped on your C drive. It uses tf shelve to create a TFS shelveset called "Daily Backup - Your Name".  It will replace that same shelveset every day with all your current changes (or however often you have the Windows Scheduled Task runs).

This way, you will always have a backup copy of your daily changes. It's always nice to be on the safe side, even if you think you don't need it.  A few developers have had their machines crash on them and had to have the machine re-imaged. This would have came in handy back then.  I could have built a custom TFS add-in or app, but I figured this was extremely easy to just use a batch file and windows task.  Anyway, to set this up, just follow the steps below:

  1. Open notepad and paste these two lines in:

    call "C:\Program Files\Microsoft Visual Studio 9.0\Common7\Tools\vsvars32.bat"
    tf shelve "Daily Backup - YOUR_NAME" /noprompt /replace > "C:\TFSBackupLogFile.txt"
  2. Edit the title in the 2nd line to include your name and edit the path at the end of the 2nd line to map the log file
  3. Save the file to your desktop (or anywhere you'd like) and name it TFSBackup.bat
  4. Click Start > Control Panel > Scheduled Tasks > Add Scheduled Task
  5. Walk through the scheduled task Wizard and point it to the TFSBackup.bat file you created
  6. Set the Task to run daily at whatever time you want
  7. Run the task to make sure it runs executes the bat file successfully and check TFS to make sure your shelveset was created

You can view TFS Shelvesets by opening Visual Studio > File > Source Control > Unshelve Pending Changes.

 

 

 

  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Posted On Tuesday, September 15, 2009 11:14 PM | Feedback (5) |

Thursday, September 03, 2009

Visual Studio TFS Work Item Search Plugin

If you're accessing work items in Team Foundation Server from the Visual Studio IDE, you will end up using this plugin more than you might think.  I'm surprised they only have 3194 downloads. It basically does exactly what it says.  You can either type in a work item ID to immediately bring up the work item, or type in text to search through work items (like a word or two that would be in the Title or Description).  If you're using Visual Studio 2008, check it out. Here's the link to where it lives on codeplex:

http://searchworkitems.codeplex.com/



- mike
  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Posted On Thursday, September 03, 2009 9:21 PM | Feedback (0) |

Monday, August 10, 2009

Bing vs Google

If you're a big search junkie, check out this site: http://www.bing-vs-google.com/. It's the best comparision tool that I've seen out there so far that will really let you see the differences between the two huge search giants in the industry.

Developers love tools :)

 

 

  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Posted On Monday, August 10, 2009 8:51 PM | Feedback (0) |

Wednesday, August 05, 2009

TFS - Deploying To Multiple Environments Using Team Build

Using TFS and Team Build to deploy to Development, Integration, QA, Stage, Pre Production, or any other testing servers you have can be quite a bit of a challenge sometimes. I haven't really found a lot of documentation or best practices out there for it either. There are plenty of ways to move the files across each environment. I'm going to try this build definition out for a while and see how well it works. 

When I queue a new build definition up, I'm going to pass in the following parameters (they will be different each time I queue a new build so I can specify exactly what I need):
/p:GetVersion=C1306
/p:DeployTo=Dev



These parameters are used to tell my build definition which source control version I want to build and which environment I want to deploy the files to.  The GetVersion parameter can accept a changeset number, label, date, "W" (Version last fetched to your workspace), or "T" (latest version).  The DeployTo parameter can accept Dev, QA, or Stage. You can also default the parameters by setting the values in the .rsp file. See the following links for more information on how these are being used:

Building a Specific Version with Team Build 2008
MSBuild Conditional Constructs

Here's a sample build definition that uses the parameters:

<?xml version="1.0" encoding="utf-8"?>

<!-- DO NOT EDIT the project element - the ToolsVersion specified here does not prevent the solutions

     and projects in the SolutionToBuild item group from targeting other versions of the .NET framework.

     -->

<Project DefaultTargets="DesktopBuild" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5">

  <Import Project="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\TeamBuild\Microsoft.TeamFoundation.Build.targets" />

 

  <ProjectExtensions>

    <ProjectFileVersion>2</ProjectFileVersion>

    <Description></Description>

    <BuildMachine>TFSRTM08</BuildMachine>

  </ProjectExtensions>

 

  <PropertyGroup>

    <TeamProject>MikeTFS</TeamProject>

    <BuildDirectoryPath>c:\bw\-1</BuildDirectoryPath>

    <DropLocation>\\UNKNOWN\drops</DropLocation>

    <RunTest>false</RunTest>

    <RunCodeAnalysis>Never</RunCodeAnalysis>

    <WorkItemType>Bug</WorkItemType>

    <WorkItemFieldValues>System.Reason=Build Failure;System.Description=Start the build using Team Build</WorkItemFieldValues>

    <WorkItemTitle>Build failure in build:</WorkItemTitle>

    <DescriptionText>This work item was created by Team Build on a build failure.</DescriptionText>

    <BuildlogText>The build log file is at:</BuildlogText>

    <ErrorWarningLogText>The errors/warnings log file is at:</ErrorWarningLogText>

    <UpdateAssociatedWorkItems>true</UpdateAssociatedWorkItems>

    <AdditionalVCOverrides></AdditionalVCOverrides>

    <CustomPropertiesForClean></CustomPropertiesForClean>

    <CustomPropertiesForBuild></CustomPropertiesForBuild>

    <SkipWorkItemCreation>true</SkipWorkItemCreation>

  </PropertyGroup>

 

  <Choose>

    <When Condition=" '$(DeployTo)'=='Dev' ">

      <PropertyGroup>

        <DeployPath>\\MikesDevServer\Websites\MikesWebApplication</DeployPath>

      </PropertyGroup>

    </When>

    <When Condition=" '$(DeployTo)'=='QA' ">

      <PropertyGroup>

        <DeployPath>\\MikesQAServer\Websites\MikesWebApplication</DeployPath>

      </PropertyGroup>

    </When>

    <When Condition=" '$(DeployTo)'=='Stage' ">

      <PropertyGroup>

        <DeployPath>\\MikesStageServer\Websites\MikesWebApplication</DeployPath>

      </PropertyGroup>

    </When>

  </Choose>

 

  <ItemGroup>

    <SolutionToBuild Include="$(BuildProjectFolderPath)/../../Development/Websites/MikesWebApplication/MikesWebApplication.sln">

      <Targets></Targets>

      <Properties></Properties>

    </SolutionToBuild>

  </ItemGroup>

 

  <ItemGroup>

    <ConfigurationToBuild Include="Release|Mixed Platforms">

      <FlavorToBuild>Release</FlavorToBuild>

      <PlatformToBuild>Mixed Platforms</PlatformToBuild>

    </ConfigurationToBuild>

  </ItemGroup>

 

  <Target Name="AfterDropBuild" >

   

    <!--Delete Previous Deployment-->

    <CreateItem Include="$(DeployPath)\**\*.*" Exclude="$(DeployPath)\**\Web.Config">

      <Output ItemName="PreviousDeployment" TaskParameter="Include" />

    </CreateItem>

    <Delete Files="@(PreviousDeployment)" ContinueOnError="true" />

 

    <!--Define New Deployment Files To Be Copied-->

    <ItemGroup>

      <Compile Include="$(DropLocation)\$(BuildNumber)\Mixed Platforms\Release\_PublishedWebsites\**\*.*"

               Exclude="$(DropLocation)\$(BuildNumber)\Mixed Platforms\Release\_PublishedWebsites\**\Web.Config"/>

    </ItemGroup>

   

    <!--Deploy-->

    <Copy SourceFiles="@(Compile)" DestinationFolder="$(DeployPath)\%(RecursiveDir)"></Copy>

   

  </Target>

</Project>


Hope this helps! Leave me some feedback if you get a chance. Thanks everyone.
  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Posted On Wednesday, August 05, 2009 3:49 PM | Feedback (1) |

Monday, August 03, 2009

Team Build - Delete All Files - Include and Exclude

A few days ago I needed to delete all files except for web.configs out of a deployment folder using Team Build.  I added the code below to the build definitions .proj file.  It's a quick and easy way to clean out some, but not all, of the files in the deployment folder. You can use wildcards in the CreateItem tag.  It's not perfect because it isn't made to deal with deleting empty sub folders but it got the job done for what I needed.

  <PropertyGroup>

    <DeployPath>\\MikesServer\Websites\TestWebsite</DeployPath>

  </PropertyGroup>
 

  <Target Name="AfterDropBuild" >

    <CreateItem Include="$(DeployPath)\**\*.*" Exclude="$(DeployPath)\**\Web.Config">

      <Output ItemName="PreviousDeployment" TaskParameter="Include" />

    </CreateItem>

    <Delete Files="@(PreviousDeployment)" ContinueOnError="true" />

  </Target>

 

 

There are a few other ways you can clean out a folder. The delete task is the one I used above. An easy way to delete everything is to use the <RemoveDir Directories="$(OutputPath)\dir" /> and <MakeDir Directories="$(OutputPath)\dir" /> tags. You can also use a MSBuild tasks library such as SDC Tasks and use the CleanFolder task to delete everything in a folder.
  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Posted On Monday, August 03, 2009 10:43 PM | Feedback (0) |

Thursday, July 02, 2009

TFS Unshelve Changeset Search Wildcard

All of our developers have recently been dealing with a lot of shelving and unshelving in Team Foundation Server to share code. When unshelving shelvesets, we get prompted to fill in an Owner name text box.  If you don't know the owners user name, an easy way to search through shelvesets is by entering an asterisk in the Owner name text box and then pressing the find button.  This wildcard will bring up all the shelvesets available for you to unshelve. It's a handy little trick when you need to broaden your search.
 


I thought this was a pretty common known trick among TFS users but I've found more and more people didn't even know this existed, so I figured I'd throw a blog up about it.  Hope that helps.

 

- Mike

  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Posted On Thursday, July 02, 2009 10:26 PM | Feedback (0) |

Saturday, June 20, 2009

Team Build 260 Character Path Limit Workaround

We've recently implemented a new branching strategy for our Team Foundation Server's Source Control. It was a great idea that's working out well but it caused a few problems with our Continuous Integration builds.  The builds were failing with this error:

The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters.

It's a pretty common error and I'm sure most of you build engineers have seen this before. Keep in mind that this is not a TFS limitation, it is caused by a Windows limitation.  An easy way to fix this it to change the working directory of your Build Agent:

  1. In your Team Explorer 2008 window, right click on the Builds folder
  2. Click on Manage Build Agents
  3. Make sure your build agent is highlighted and click the Edit button
  4. Change the default working directory from $(Temp)\$(BuildDefinitionPath) to C:\b\$(BuildDefinitionId)


This will give you a lot of extra characters for your build server to work with.  The file path still needs to be under 260 characters though.  If you're wondering which C drive this references, it's the C drive on your build server. By changing this I've shortened the working directory path:

  • From: C:\Documents and Settings\tfsBuild\Local Settings\Temp\MikeTFS\Development - MikesProgram
  • To:      C:\b\1
You can delete everything out of the old working directory to free up some space on the build server if you're no longer using those builds.


So that should fix the issue. I did also want to give a little more information on working directories. Working directories are stored on your build server.  The working directory can be referenced by each build definition. Each time a new build is queued, a working directory folder will be created or modified under C:\b\$(BuildDefinitionID). Three sub folders are created inside this working folder (Binaries, BuildType, and Sources):

Binaries
folder: Contains the binary output from the build
BuildType
folder: Contains the build log and MSBuild files (TFSBuild.proj, TFSBuild.rsp, TFSBuild.tbrsp)
Sources folder: Contains the files downloaded to the build server mapped by the build definition you set up. See below.

For example, for the sources folder, TFS will perform a GET on the workspace you specify in the build definition and place all the files into $(SourceDir), which in our case would be C:\b\1\Sources. It uses these files to build your application on the build server. So it's important that each build definition is mapped out correct. You can also only map the workspace working folders that you need in order to speed up your build.




Hope this helps! Leave me some feedback if you get a chance.  Thanks everyone.

- Mike

 

  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Posted On Saturday, June 20, 2009 12:40 PM | Feedback (6) |

Thursday, June 18, 2009

Life In The Cube: In The Big City

So, somehow within the past five years I’ve mapped out my life to lead to a point where I’m sitting here blogging on GeeksWithBlogs.net. I never would have guessed it…lol There’s no need for me to sweat it though. I’m a 23 year old IT college graduate that has a full time software development job, an amazing family, a loving girlfriend, and incredible friends.  As one of my co-workers recently put it: “I’m livin’ the dream” :)

I'm a former employee of iPay Technologies and currently work for Republic Bank.  The recent job hop was a pretty big deal for me but I had to take the job offer with Republic to further my career.  If I could combine the two jobs into one, I'd do it since both companies have been great places to work. As weird as it sounds, the biggest change I faced was going from working in a small town to working in the big city.  It's taken some time for me to adapt but new friends and new places to eat have made it a lot easier. I've gained a new appreciation for people that have to face the downtown traffic nightmare five days a week...lol

The main focus in my career is Microsoft Technology and .NET Development.  I've worked with tons of languages and various applications: C#, ASP.NET, Visual Basic 6.0, SQL, XML, AJAX, Javascript, Classic ASP, LINQ, Flash, jQuery, Java, Visual Studio Team System 2008, Visual Studio 2005, SQL Server Management Studio, WinMerge, Tortoise SVN, Visual SourceSafe, IIS, Firebug, IE Developer Toolbar, HttpWatch, Vice Versa Engine, Google Analytics, Google Web Optimizer, etc.

I'm currently diving into tons of Team Foundation Server experience. That's actually how I came across this blog site. I needed some help publishing a Click Once application using Team Build and Tim Hibbard's blog on this site gave me exactly what I needed.  So I thought to myself, I should look into starting a blog of my own up. Of course, that was the easy part.  Now I just have to find the time to post a few blogs out there...lol

- Mike

  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Posted On Thursday, June 18, 2009 2:50 PM | Feedback (0) |

Powered by: