Tip of the Day: Calculating durations with Moment

Moment has quite a nice fluent interface for some operations, others just need a little more thought. For example, I wanted the duration of something and I had recorded the start and end time. I thought something like this, finding the difference between two dates and converting it to a duration, would work: var duration […]

Tip of the day: Default project location in Visual Studio

When rebuilding a machine I always end up hunting this setting down just after installing Visual Studio because I keep forgetting where it is. I never put my projects in my documents directory. Ever. In Visual Studio go to Tools –> Options… then navigate to “Projects and Solutions” and in the “General” section change the […]

Really getting the latest changes with TFS

TFS Source Control doesn’t always get the latest changes. It gets what it thinks are the latest changes (and for the most part it gets it right if you work exclusively in Visual Studio). However, there are times when it gets it wrong and you have to force its hand a little. So, if you […]

How to recover deleted files, folders and branches in TFS

In Visual Studio go to the menu item Tools–>Options… Then navigate to the Source Control –> Visual Studio Team Foundation Server section. In that section is a check box that says “Show deleted items in the Source Control Explorer” Once you’ve ensured that the checkbox is checked, press “OK” Then navigate to the Source Control […]

There were build errors. Would you like to continue and run the last successful build?

Oh, Would I! Could I really do that?!?  Well yes, but I cannot think of any situation where I would want to do this. I’m not saying there isn’t a time I might conceivably possibly maybe actually want this, but I can’t think of it right now and I’ve not come across that situation for […]

Tip of the day: Quickly finding commented out code in C-like languages

This is a quick rough-and-ready way of finding commented out code in languages like C#, C++, javaScript and Java. It won’t find all instances, but it will probably find most. Essentially, you can use a regular expression to search through the source code looking for a specific pattern. The following works for Visual Studio for […]

Tip of the day: Forcing a file in to your Git repository

Normally, you’ll have a .gitignore file that defines what should not go into a git repository. If you find that there is a file or two that is ignored that you really need in the repository (e.g. a DLL dependency in a BIN folder for some legacy application that doesn’t do NuGet, or other package […]

Tip of the Day: Make Outlook 2013 display the Weather in Celsius

At work we’re upgrading to Outlook 2013. One of the new features is that the Calendar will display the weather for the next few days. If you like this, that’s great. However, most of the world uses Celcius, but out of the box Outlook displays Fahrenheit (regardless of the locale set up on your machine). […]

Tip of the Day: Getting TFS to remember you each time you open Visual Studio

Because the TFS Server where I work is not on the domain, it will prompt you for credentials each time you log in (unless you’ve previously used the web access and checked the “Remember Me” option). If you don’t want to use the web access portal, you can still get TFS to remember your credentials […]

Tip of the day: How to tell why your app couldn’t log on to SQL Server

When you get a log in failure on SQL Server the message you get back from SQL Server Management Studio, or in a .NET Exception is vague for security. They don’t want to give away too much information just in case. For example, the exception message will be something like “Login failed for user ‘someUser’.” […]