Friday, December 23, 2011

TFS vNext needs audit log reports

Because of some governmental regulations, we need to report the administrative actions over permissions on TFS. Auditors frequently request such reports from us.

I requested the audit logs of administrative actions over permissions on TFS from Microsoft in the VS vNext Wish List.

We'll see what Microsoft thinks about adding audit reports to TFS in the next version. What do you think, is it worth?

Thursday, December 22, 2011

TFS Case Study of Microsoft Turkiye

Microsoft Turkiye examined our TFS implementation and published a case study document:

Unfortunately the document is prepared only for Turkish audience, it has no English translation.

Sunday, June 19, 2011

Count lines of code in a database

Here is a small script to count lines of code in a database:

    o.type_desc as ObjectType
    ,count(*) as [ObjectCount]
    ,sum(len(m.definition) - len(replace(m.definition, char(13), ''))) as [TotalLineCount]
from sys.objects o
inner join sys.sql_modules m on o.object_id = m.object_id
where o.[type] in ('P', 'TR', 'FN', 'IF', 'V', 'TF')
and not like 'aspnet[_]%'
and not like 'vw[_]aspnet[_]%'
group by o.type_desc
order by o.type_desc

Monday, May 30, 2011

Sign a .Net assembly without the source code

Two different versions of an old .Net assembly caused some deployment problems. We wanted to deploy the assembly to the GAC but neither of the two versions were signed. We needed to sign the assemblies but we did not have the source code.

After a small search I found a great tool named ILMerge.
Main purpose of ILMerge is to combine more than one .Net assemblies into one assembly. The side benefit is that you can also sign the resulting assembly. It works while working with only one assembly too. This way you can sign an assembly without having the source code.
Sample command line:

ilmerge /t:library /keyfile:"c:\SomeKeyFile.snk" /out:"c:\signed\assembly.dll" "c:\unsigned\assembly.dll"

Wednesday, May 4, 2011

Entity framework class generator

I wrote a sql script to generate entity framework POCO classes:

Script considers primary and foreign keys including both "one to one" and "one to many" relations.

It also writes sql object descriptions saved as extended properties to the class and property comments of POCO classes.

It is working for MS SQL 2008 and 2008 R2. I did not try to run the script on other versions.