If you haven’t heard already, there are two new user groups starting up in the Philadelphia Area. Both are hosted on meetup.

ALM

The first is Philly Application Lifecycle Management User Group. The group’s first meeting is Thursday 2/27, 6pm at the Microsoft MTC in Malvern. The topic is “Getting the Most from Team Foundation Server 2013. And the speaker is… ME! I hope you’ll come out and help get this new group started. Here is a summary of the talk:

TFS is a powerful tool for many things including Work Item Tracking, Source Control and more. But what can you do when the standard templates just don’t fit your needs? Every team is different. Did you know that it is actually pretty easy to customize many parts of TFS to fit your team’s process? I’ve recently upgraded an entire IT department’s source control and work item tracking from TFS 2008 to TFS 2013. During the process I customized many facets of TFS. In this talk, I’ll share what I learned along the way. When we are done, you’ll be set to start getting the most from TFS.

Xamarin

The second new group is the Philly Area Xamarin Group. Their first meeting is Tuesday March 11. Looks like the first one is a meet and greet at Field House in Philadelphia. That sounds like fun.

I recently did a presentation of VS tips at the Philly.Net user group. My presentation included some tips for Visual Studio 2013 as well as some for older versions. I’ve bundled 3 related tips into one post here.

Clipboard Ring

The first tip is one that applies to past versions of Visual Studio but it always surprises me how few people know about this. When you are pasting content in Visual Studio, instead of using the traditional Ctrl + V to paste, use Ctrl + Shift + V to cycle through the clipboard ring. It is simple and easy to use. Sometimes I use Ctrl C to copy some text and when I try to paste it I hit Ctrl C again by mistake. Now I just copied a (usually) blank line into my clipboard and I can’t get back to the text I really wanted to paste. Fear not, Ctrl + Shift + V to the rescue and I can cycle back through the clipboard to the text I really wanted.

Avoid Copying Blank Lines

In the tip above, I mentioned a common scenario where I sometimes use Ctrl + C by mistake when I really want Ctrl V for “paste”. Sure the clipboard ring can help solve that problem but VS 2013 introduces a new feature. Just click on over to the options page at Tools > Options and then navigate to Text Editor > All Languages (or better yet, use Quick Launch and type in “blank lines”). You’ll see this:

image

In your case, the checkbox is probably checked. Uncheck it and you won’t have to worry about this again!

Box Selection/Column Mode

Once again, this feature has been in VS for a long time but many, many devs still don’t know about it. Everyone (right?) knows about using Ctrl + right/left arrows (or the mouse) to select text. But in the following sample, I realize that I have four variables declared as string but they should be int.

image

To fix them, I can just use Ctrl + Alt + the arrows or the mouse. But now, it is not just the left and right arrows but the up and down arrows as well.

image

And while that is selected, I can just start typing:

image

Play around with this. You can also use it to insert totally new text on all lines too.

I’m in the process of migrating our TFS Instances to 2013. During my research I’d seen demos with the “Features” feature. In TFS 2013, there is now a Work Item Type named Feature which is meant to be a parent to several Product Backlog Items. I was able to easily create features but I also knew there is supposed to be a Features Backlog. On my TFS cloud instance it works fine but there was no sign of the Features backlog on the web interface for my On Premise instance of TFS 2013. The screenshot shows what I was hoping to find. Continue below to find out how to enable it.

image

It turns out that getting this to show up was really quite simple but not exactly intuitive. Features needs to be enabled as part of the Access Levels portion of TFS.

On the top right side of the TFS web app, click the “gear” to go to the control panel.

image

You may see this menu. If not, skip the next step! If you do, just click the Control Panel link to go to the main control panel page.

image

Hopefully you will see a menu like this:

image

From here, click on “Access Levels” and you’ll see something like this:

image

 

You will see that there are 3 choices for access levels. We’ve got “Standard” set as the default. I’m not positive we’ll keep it this way and every team should decide for themselves what they want to do about the default. However, you must have “Full” Access to see the “Features” backlog. So add some users to that level or set it as the default. Once you do, users with Full Access will see the Features Backlog (similar to the first screenshot in this post).

I’m not exactly sure why the access levels are set up like this. I’m new to TFS2013 so it may be possible to set this visibility in other ways. But it seems odd that enabling the Features backlog is tied to other features like “Team Rooms” and “Test Case Management”. Those are great features but I am not sure why they are all lumped together.

I recently found out the hard way that the underscore character “_” can be problematic within URLs, particularly with Internet Explorer. Here is why…

(FYI, my testing was done with IE 9)

First of all, the underscore character is a perfectly acceptable character in a URL. Web browsers can deal with it fine in most circumstances. However, IE seems to dislike the underscore when it is in a domain or subdomain name, for instance www.my_site.com or test_site.mysite.com. Will it work? Under general circumstances it might. The problem shows up when you need a cookie for the site, which most sites do, especially if you are using cookies as part of your authentication scheme. IE can’t create cookies when the domain or subdomain name has an underscore.

This doesn’t seem to be a problem for Firefox (I’ve tried it) and Chrome (so I have heard).

A note about SEO

Also, it is worth mentioning that the underscore is not a good choice in a URL if you are interested in SEO. That’s because some search engines like Google don’t consider the underscore a word separator. To Google, it reads a URL like “mysite.com/Page_About_Something_Cool” as mysite.com/pageaboutsomethingcool” which won’t help your rankings much. Bing is fine with the underscore but of course simply using a dash “-“ instead will keep both search engines happy.

I’ll close with a few examples

www.somesite.com/page-with-content good choice for a variety of browsers and search engines
mysubdomain.somesite.com/page-with-content good choice for a variety of browsers and search engines
www.some_site.com trouble for IE with cookies
sub_domain.somesite.com trouble for IE with cookies
www.somesite.com/page_with_content valid but bad for SEO with Google
Posted in Web.

In trying to set this up, I kept finding articles and blog posts that had instructions that didn’t work. In the end, setting this up was pretty easy.

First off, I am running IIS 7.5 on Windows Server 2008 R2. If you have a different set up, this might not work for you.

First, the problem – a pretty common one:

We’ve got our Application Pools set to recycle once a day. However, each time the app pool recycles the first user to hit the site has to wait while everything warms up again. That wait can be 30 seconds or so which is a pretty long time. So I want my application to be ready all the time, even after an Application Pool reset.

Side note… I don’t recommend using the default settings for app pool recycling. If you do, the pool will recycle every 1740 minutes. However, that time could end up being in the middle of a busy day. That would be bad. Instead, I set mine to recycle at around 3 AM when no one is using my site. Of course, you may have different needs.

The Solution

Setup

IIS 7.5 has a feature called Application Initialization. I’ve seen many blog posts about it. Some say you can use the GUI to configure it. Some say you configure it via a .config file. Most of them imply that the feature is there and ready to be used. For me it was not installed by default and there was no GUI. I’m not sure why. Are my servers (prepared by a different team) configured to not have this feature? I don’t know.

In any case, installing this feature is easy. Just go here and install the Application Initialization Module for IIS 7.5. It is pretty quick but will require a reboot.

Once you do, open IIS and click on the server node and in the main window under Management, click on Configuration Editor:

image

Inside the editor, set the section (via the dropdown at the top) to “system.webServer/applicationInitialization”. If you can do that, the installation was successful! Prior to installing, that node wasn’t there! Interestingly, there are some settings here that imply you can change them via the UI. For instance, I tried setting “doAppInitAfterRestart” to True. Not only did that not help, it caused errors with IIS. So why is it there? I have no idea. My advice… don’t touch those settings.

image

Configuration

IIS is all set but now you need to tell it which app pools and websites you want it to start. Simply go to:

C:\Windows\System32\inetsrv\config

and open the applicationHost.config file. You may want to back the file up before you make changes.

You’ll need to add two things.

1. The App Pool:

Find the applicationPools node. Within it it you will find each app pool listed. Here is an example:

<add name=”YOURAPPNAMEHERE” autoStart=”true” managedRuntimeVersion=”v4.0″ startMode=”AlwaysRunning”>
<processModel identityType=”ApplicationPoolIdentity” loadUserProfile=”true” />
<recycling logEventOnRecycle=”Time, Requests, Schedule, Memory, IsapiUnhealthy, OnDemand, ConfigChange, PrivateMemory” />
</add>

Simply add the highlighted text startMode=”AlwaysRunning”. You will note that it probably already says autoStart=”true” but yet it didn’t autostart. Another misleading part of this, huh? Oh well.

2. The Web Site

Go to the sites node and find your site which will look something like this:

<site name=”YOURSITENAMEHERE” id=”4″ serverAutoStart=”true”>
<application path=”/” applicationPool=”YOURAPPPOOL” preloadEnabled=”true”>
<virtualDirectory path=”/” physicalPath=”C:\inetpub\wwwroot\YOURSITENAME” />
</application>
</site>

Once again, add the highlighted text.

Validation

How do we know it works? That is easy…

  1. Open up the task manager and go to the processes tab.
  2. Sort by Image Name and find the process w3wp.exe. There may be multiple instances. The Username should be the name of the apppool.
  3. If you try to End the Process, you will find that it restarts itself. Seems like it won’t go away ever. Uh oh, how do you stop it then?
  4. To stop the process you must stop the application pool.
  5. Of course, if you restart the app pool you will find that the w3wp process comes back. But wasn’t that what you wanted in the first place?

Problem solved. Enjoy.