Wednesday, April 24, 2013

MSSQL: Shrink transaction log

Common issue, right. Let's do it.

1. Go to your database in Management Studio.
2. Right click on the database and select Tasks -> Backup. Choose Transaction Log as Backup type.

3. When backup is taken, right click on database, select Tasks -> Shrink -> Files. Choose File type Log.
In 95% of cases that will do the trick.

In 5% of unlucky events, log file is not getting less, but there is no error displayed. If you have that, click Script on the previous screenshot (Shrinking log file). And then run script to do the job, and click on Messages at Output window.
You will see smth like this: 
Cannot shrink log file 2 because the logical log file located at the end of the file is in use.

Then you need some extra steps.
2a. Right-click your database and select Properties. At Options tab set Recovery model to Simple.
Do Step 3.
3a. Set recovery model back to Full. 

Good luck!

Tuesday, April 9, 2013

Some features of Team Web Access are not visible to you

Installing TFS, going to Team Web Access and observing something lilke this?
And there is no Backlog and Sprint Planning Tools and neither can you see Request Feedback feature.

You need to enable all features. Somehow by default they are set to "Standard" level, not "Full".
Enter administration page and go to Control Panel:

Select Full and make it default.


That will do!

Thursday, April 4, 2013

Configure SSL in IIS :The process cannot access the file because it is being used by another process.

Tja... annoying! Obviously someone else is listening on 443, let's find out who.

Command prompt: netstat -ano
Looking for port 443 and memorizing PID.

Troublesome PID = 8952. Open Task manager -> Processes - sort by PID.
Ah, here it is. Skype! Kill it, and you will be able to successfully configure your web site to work over SSL.

TFS 2012 Velocity chart

Here I will explain what is it the velocity chart in TFS 2012 shows. Generally - velocity shows how much a team can do during a sprint.

So it comes to - how do you estimate effort. IN TFS 2012 we use User Stories, and for estimates - Story Points. This is essential to remember. Look here, an example of velocity chart:
First of all, on X-axis - iteration ordered by time. This means you have to set timeframe for your iterations. For this go to admin page and Iterations tab.

Y-axis. See numbers? Those are story points. If your work items do not have story points - they will not appear on this chart.

Now about colours. Green shows work items in Resolved\Completed\Done state. Blue - Active. Other states are not shown.

Hope that clarifies some things.

Tuesday, March 12, 2013

CodeMetrics and VS 2012 workaround

As it is for now, running metrics.exe on a machine which doesn't have VS 2010 gives you an error:

Could not locate C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\metrics.exe. Please download Visual Studio Code Metrics PowerTool 10.0 at http://www.microsoft.com/downloads/en/details.aspx?FamilyID=edd1dfb0-b9fe-4e90-b6a6-5ed6f6f6e615

Downloading and installing as it says - doesn't really help, it gives yet another error about missing dll or one of its dependencies.

So, to be able to run code metrics tool on a machine without VS 2010 installed, do the following:

1. Create folder C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools
2. Copy over the whole Static Analysis Tools folder there from the machine with VS2010.
3. Copy Microsoft.VisualC.dll version 10.0.0.0 to the FxCop subfolder of Static Analysis Tools folder.

This made the trick.

UPDATE: It's finally there! See CodeMetrics for VisualStudio 2012.

Saturday, March 2, 2013

Best tools ever: LINQPad

I thought to make serie of posts about tools I use daily, and can't imagine life without.
And I start with my very favourite - LINQPad.

So often there is a code snippet we just want to try, and starting all the hussle with opening Visual Studio, creating project, etc etc... uff, it is just too much. Life should be easy - write & run!

And that is exactly what LINQPad allowes me to do.

So start LINQPad - and you get a window to write your code:

 
Select a C# statement, and - write your code. In this particular example I query for build definitions, and if I press Run, it will show me the result in nice format:


Of course, there are dlls I need to reference. To add references required by your code - right click on the code field and choose Query Properties.


And look - there is even NuGet there.

 Best news ever - you can get it for free. If you would like to have code autocompletion - it will cost you some, otherwise - totally free of charge.

I have to add that LINQPad can do much more than what I mostly use it for, so - try it and I am 100% sure you will love it.

Official site, download and examples here: http://www.linqpad.net/

Thursday, February 28, 2013

TFS + VS: Find branches of a file

Let say, you have a file initially used by one project, and later usage spred widely around other projects.
For us it happend with code analysis rules settings file.

So we decided that the best is to branch this file. Having it in one place get you into relative paths hell, just copying across projects... hmmmm.... no so good - gets out of control sooner or later.
Brnach it - and you know where it is and which version.

What I found not so obvious - is where to find all branches taken from the file?

Locate file in Source control, right-click -> Advanced -> Properties.
Here it is - Branches tab:



Hope it helps somebody :)