Category: Visual Studio


We are getting close to releasing one of the projects at work. A website developed in ASP.NET using Visual Studio 2008.

With a project like this you need to test it in multiple web browsers to ensure that you cover all the bases when it comes to release time. The last thing you want is for the site to work in the specific version of a browser but not earlier versions of that browser or other browsers.

Testing in multiple browsers is easy enough, you just install them on your local development machine. However, testing a site in both IE7 and IE8 (for example) becomes more difficult. Even more so when you want to test on a Mac running OS X.

There are a number of immediate options that string to mind:

  1. You could develop against IE7 then upgrade to IE8 to fix any bugs.
  2. Develop against IE8 and downgrade to IE7 for testing and debugging (reverse of above).
  3. Test using VMs or remote client machines.

The first two options would be nice, but there are issues. Supposing the “fixes” break the site against the initial browser version you developed again. Add to that that the un-installation of IEx is not something I ever want to undertake after previous experience!

Option 3 sounds good, except that Microsoft have prevented you from accessing the ASP.NET Development Server from anything but localhost. Therefore you cannot browse to the site from any remote machine.

After some googling, I found the solution.

Visit the site for the complete lowdown, but for future reference by myself (and in case that site goes down at any time for any reason), here is a brief account.

  1. Download the Microsoft SOAP Toolkit from here.
  2. Install it.
  3. Start Microsoft SOAP Toolkit Version 3 > Trace Utility.
  4. Select File | Formatted Trace.
  5. You will be prompted for the port to listen on and the machine/port to forward to.
    • Local port # is the port the remote device will connect using.
    • Destination host should remain as localhost.
    • Destination port is the port number that ASP.NET Development Server is using.

If you now connect to the IP address or hostname of your development machine using the local port specified above, you should see the site you are developing against and can debug as usual.

Neil

Today one of my colleagues needed to move some files into a sub-folder in the project’s workspace in TFS 2008 Source Control.

It seems with Team Explorer, you can move individual files by right-clicking the file and choosing Move. However, you can’t do this with multiple files selected! You can move a whole folder, but that moves the entire folder and not just the files in it, so it doesn’t work to a sub-folder within that folder.

I suggested checking out the files, moving them in the workspace on his local machine and then checking them back in. I was thinking that TFS would be aware that these files have now moved and would handle this accordingly. WRONG!

We could move them and then add them as new files in the “new” location, but this would mean they lose all the history for the files.

It turns out, you can’t move files around in Source Control using Team Explorer, but you can by using the tf.exe command-line utility provided (usually found in: C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE). You’ll need to add the correct path for your computer using the DOS Set command like this:

SET PATH=%PATH%;"C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE"

To do this you use the rename function of the utility and provide the new location for the files, like this:

  1. Get the latest copy of the files that you want to move, using Team Explorer.
  2. Open a Command Prompt and change to the drive and path where the files you want to move currently exist.
  3. Move the files to the new location using the rename function of the tf.exe command-line utility like this:

 tf rename <files> <new_location> /lock:checkin 

The following example will move all files into a sub-folder of the current folder called Video Thumbs:

 tf rename *.* "Video Thumbs" /lock:checkin 

If you now look at the Source Control new & old folders in the workspace and you should see your files have been moved. All you have to do now is check in the changes and the files are moved!

WARNING: Using a wildcard like *.* will also move folders!

During my time working with Work Items in TFS2008 I have discovered these useful commands:

 witfields <action> /s:<server_name> <field_ref_name> 

Where <action> can be: view, delete, rename, report, rebuildcache

more information can be found on MSDN here

There are also two commands available when you install the October 2008 release of the TFS 2008 Power Tools. I haven’t used them but I will have a play and update this post with more information!

They are: DestroyWITD & DestroyWI which destroys Work Item Types and Work Items respectively (instead of just deleting them!)

more information on the Power Tools can be found here

I’ve recently been playing with redesigning Work Items in TFS2008, as the Administrator of TFS.

There are certain things you can’t do, such as have a fields value calculated based on the value of one or more other fields (at least not out of the box), but I have come up with a clever way to “get around” this.

I wanted an Importance field to be the value of Priority multiplied by Severity. This couldn’t be done out of the box, and writing custom controls etc., is a little beyond me at the moment. My “solution” was to have the Importance field show Allowed Values based on what Severity (although Priority could be used instead) was set to. So if Severity was set to 3 then Importance could only be multiples of 3 up to 15.

tfs-importance

I also made it that if either Priority or Severity was changed, then Importance would be set back to an empty field. I had to use the Copy rule to set it to an empty value as using Empty, emptied the field but didn’t initially allow you to select a new valid value.

With Importance also being a Required field, when it is cleared, the user has to set a new value! I agree its not perfect, but it kind of works!!

At my current employer, I am the sole administrator for Microsoft’s Team Foundation Server 2008.

When I first started here, I took over TFS Admin, but the server was configured very strangely. So as I was required to ‘prove’ a backup/restore solution for their TFS data, it was agreed that I would also perform a new build of the TFS server.

When I first took over the admin role, there were some permission issues. I wasn’t able to create new projects. I eventually sorted this and created a ‘TEST’ project.

Having restored the existing project data to my newly built server, I wanted to remove this TEST project. From Visual Studio 2008/Team Explorer 2008 it isn’t obvious how you delete a team project from TFS.

Searching the Internet revealed it was possible using the command-line command TfsDeleteProject

Here’s an example:

TfsDeleteProject /server:<server_name> "<project_name>"

Where:
<server_name> is the name of your TFS Server
<project_name> is the name of the project to delete

Neil

Follow

Get every new post delivered to your Inbox.