<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-5246533954472307929</id><updated>2011-12-28T23:18:59.294-08:00</updated><category term='DynamicMethod'/><category term='database code line count'/><category term='wcf basichttpbinding windows security'/><category term='reflection.emit'/><category term='tfs'/><category term='dynamic method'/><category term='sorteddictionary vs dictionary; dictionary vs sorteddictionary'/><category term='ILMerge'/><category term='dynamic method within dynamic method'/><category term='tfs view history error'/><category term='dictionary performance'/><category term='sign assembly'/><category term='branching strategy'/><category term='MethodInfo must be a RuntimeMethodInfo'/><category term='migrate to tfs'/><category term='migrate from vss to tfs'/><title type='text'>Abdullah's blog on software</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://anehir.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5246533954472307929/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://anehir.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Abdullah Nehir</name><uri>http://www.blogger.com/profile/16004788413432497231</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>11</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-5246533954472307929.post-6250258577174139249</id><published>2011-12-23T00:43:00.000-08:00</published><updated>2011-12-23T00:54:10.428-08:00</updated><title type='text'>TFS vNext needs audit log reports</title><content type='html'>Because of some governmental regulations, we need to report the administrative actions over permissions on TFS. Auditors frequently request such reports from us.&lt;br /&gt;&lt;br /&gt;I requested &lt;a href="http://visualstudio.uservoice.com/forums/121579-visual-studio/suggestions/2468239-report-audit-logs-of-administrative-actions-over-p"&gt;the audit logs of administrative actions over permissions on TFS&lt;/a&gt; from Microsoft in the VS vNext Wish List.&lt;br /&gt;&lt;br /&gt;We'll see what Microsoft thinks about adding audit reports to TFS in the next version. What do you think, is it worth?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5246533954472307929-6250258577174139249?l=anehir.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anehir.blogspot.com/feeds/6250258577174139249/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://anehir.blogspot.com/2011/12/tfs-vnext-needs-audit-log-reports.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5246533954472307929/posts/default/6250258577174139249'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5246533954472307929/posts/default/6250258577174139249'/><link rel='alternate' type='text/html' href='http://anehir.blogspot.com/2011/12/tfs-vnext-needs-audit-log-reports.html' title='TFS vNext needs audit log reports'/><author><name>Abdullah Nehir</name><uri>http://www.blogger.com/profile/16004788413432497231</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5246533954472307929.post-1217442260683260769</id><published>2011-12-22T23:30:00.000-08:00</published><updated>2011-12-22T23:33:39.972-08:00</updated><title type='text'>TFS Case Study of Microsoft Turkiye</title><content type='html'>Microsoft Turkiye examined our TFS implementation and published a case study document:&lt;br /&gt;&lt;a href="http://www.microsoft.com/turkiye/casestudies/tfkb_tfs.aspx"&gt;http://www.microsoft.com/turkiye/casestudies/tfkb_tfs.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Unfortunately the document is prepared only for Turkish audience, it has no English translation.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5246533954472307929-1217442260683260769?l=anehir.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anehir.blogspot.com/feeds/1217442260683260769/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://anehir.blogspot.com/2011/12/tfs-case-study-of-microsoft-turkiye.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5246533954472307929/posts/default/1217442260683260769'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5246533954472307929/posts/default/1217442260683260769'/><link rel='alternate' type='text/html' href='http://anehir.blogspot.com/2011/12/tfs-case-study-of-microsoft-turkiye.html' title='TFS Case Study of Microsoft Turkiye'/><author><name>Abdullah Nehir</name><uri>http://www.blogger.com/profile/16004788413432497231</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5246533954472307929.post-1521997307429201605</id><published>2011-06-19T22:36:00.000-07:00</published><updated>2011-06-28T05:45:49.542-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='database code line count'/><title type='text'>Count lines of code in a database</title><content type='html'>&lt;div&gt;Here is a small script to count lines of code in a database:&lt;/div&gt;&lt;br /&gt;&lt;div style="font-family:courier;color:blue;font-size:13px;"&gt;&lt;br /&gt;select&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;o.type_desc as ObjectType&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;,count(*) as [ObjectCount]&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;,sum(len(m.definition) - len(replace(m.definition, char(13), ''))) as [TotalLineCount]&lt;br /&gt;from sys.objects o&lt;br /&gt;inner join sys.sql_modules m on o.object_id = m.object_id&lt;br /&gt;where o.[type] in ('P', 'TR', 'FN', 'IF', 'V', 'TF')&lt;br /&gt;and o.name not like 'aspnet[_]%'&lt;br /&gt;and o.name not like 'vw[_]aspnet[_]%'&lt;br /&gt;group by o.type_desc&lt;br /&gt;order by o.type_desc&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5246533954472307929-1521997307429201605?l=anehir.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anehir.blogspot.com/feeds/1521997307429201605/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://anehir.blogspot.com/2011/06/count-lines-of-code-in-database.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5246533954472307929/posts/default/1521997307429201605'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5246533954472307929/posts/default/1521997307429201605'/><link rel='alternate' type='text/html' href='http://anehir.blogspot.com/2011/06/count-lines-of-code-in-database.html' title='Count lines of code in a database'/><author><name>Abdullah Nehir</name><uri>http://www.blogger.com/profile/16004788413432497231</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5246533954472307929.post-1491850830557238064</id><published>2011-05-30T01:32:00.000-07:00</published><updated>2011-05-30T01:52:22.552-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='sign assembly'/><category scheme='http://www.blogger.com/atom/ns#' term='ILMerge'/><title type='text'>Sign a .Net assembly without the source code</title><content type='html'>&lt;span class="Apple-style-span"&gt;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.&lt;/span&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;&lt;br /&gt;&lt;/span&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;After a small search I found a great tool named &lt;a href="http://www.microsoft.com/downloads/en/details.aspx?FamilyID=22914587-b4ad-4eae-87cf-b14ae6a939b0&amp;amp;displaylang=en"&gt;ILMerge&lt;/a&gt;.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;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.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;Sample command line:&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;ilmerge /t:library /keyfile:"c:\SomeKeyFile.snk" /out:"c:\signed\assembly.dll" "c:\unsigned\assembly.dll"&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5246533954472307929-1491850830557238064?l=anehir.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anehir.blogspot.com/feeds/1491850830557238064/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://anehir.blogspot.com/2011/05/sign-net-assembly-without-source-code.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5246533954472307929/posts/default/1491850830557238064'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5246533954472307929/posts/default/1491850830557238064'/><link rel='alternate' type='text/html' href='http://anehir.blogspot.com/2011/05/sign-net-assembly-without-source-code.html' title='Sign a .Net assembly without the source code'/><author><name>Abdullah Nehir</name><uri>http://www.blogger.com/profile/16004788413432497231</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5246533954472307929.post-729322520125309079</id><published>2011-05-04T01:20:00.000-07:00</published><updated>2011-05-04T01:26:19.363-07:00</updated><title type='text'>Entity framework class generator</title><content type='html'>I wrote a sql script to generate entity framework POCO classes: &lt;a href="https://gist.github.com/954916"&gt;https://gist.github.com/954916&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Script considers primary and foreign keys including both "one to one" and "one to many" relations.&lt;br /&gt;&lt;br /&gt;It also writes sql object descriptions saved as extended properties to the class and property comments of POCO classes.&lt;br /&gt;&lt;br /&gt;It is working for MS SQL 2008 and 2008 R2. I did not try to run the script on other versions.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5246533954472307929-729322520125309079?l=anehir.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anehir.blogspot.com/feeds/729322520125309079/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://anehir.blogspot.com/2011/05/entity-framework-class-generator.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5246533954472307929/posts/default/729322520125309079'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5246533954472307929/posts/default/729322520125309079'/><link rel='alternate' type='text/html' href='http://anehir.blogspot.com/2011/05/entity-framework-class-generator.html' title='Entity framework class generator'/><author><name>Abdullah Nehir</name><uri>http://www.blogger.com/profile/16004788413432497231</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5246533954472307929.post-8160006650027424978</id><published>2010-09-06T00:21:00.000-07:00</published><updated>2010-09-06T23:42:45.208-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='reflection.emit'/><category scheme='http://www.blogger.com/atom/ns#' term='dynamic method within dynamic method'/><category scheme='http://www.blogger.com/atom/ns#' term='MethodInfo must be a RuntimeMethodInfo'/><category scheme='http://www.blogger.com/atom/ns#' term='DynamicMethod'/><category scheme='http://www.blogger.com/atom/ns#' term='dynamic method'/><title type='text'>C#: Call DynamicMethod within another DynamicMethod</title><content type='html'>Today I tried to call a dynamic method within another dynamic method.&lt;br /&gt;&lt;br /&gt;First I built a dynamic method, m1dyn:&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255); font-style: italic;font-family:verdana;" &gt;DynamicMethod m1dyn = new DynamicMethod("m1", typeof(string), new[] { typeof(string) });&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255); font-style: italic;font-family:verdana;" &gt;var il = m1dyn.GetILGenerator();&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255); font-style: italic;font-family:verdana;" &gt;il.Emit(OpCodes.Ldarg_0);&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255); font-style: italic;font-family:verdana;" &gt;il.Emit(OpCodes.Ret);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Then I created a delegate and assigned it to a delegate variable named m1:&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255); font-style: italic;"&gt;Func&amp;lt;string, string&amp;gt; m1 = (Func&amp;lt;string, string&amp;gt;)m1dyn.CreateDelegate(typeof(Func&amp;lt;string, string&amp;gt;));&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Then I built a second dynamic method, m2dyn:&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255); font-style: italic;"&gt;DynamicMethod m2dyn = new DynamicMethod("m1", typeof(string), new[] { typeof(string) });&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255); font-style: italic;"&gt;var il2 = m2dyn.GetILGenerator();&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255); font-style: italic;"&gt;il2.Emit(OpCodes.Ldarg_0);&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255); font-style: italic;"&gt;il2.Emit(OpCodes.Call, m1.Method);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;I simply emitted a code which calls the method info of the first delegate variable, m1.&lt;br /&gt;When I ran the code, I got the following error at the last line above:&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0); font-style: italic;"&gt;"MethodInfo must be a RuntimeMethodInfo. Parameter name: meth"&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;What I had to do was to emit a call instruction with the first dynamic method variable itself, not the resulting delegate:&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(51, 51, 255);"&gt;il2.Emit(OpCodes.Call, m1dyn);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Complete code is below:&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255); font-style: italic;"&gt;public static void Test()&lt;br /&gt;{&lt;br /&gt;DynamicMethod m1dyn = new DynamicMethod("m1", typeof(string), new[] { typeof(string) });&lt;br /&gt;var il = m1dyn.GetILGenerator();&lt;br /&gt;il.Emit(OpCodes.Ldarg_0);&lt;br /&gt;il.Emit(OpCodes.Ret);&lt;br /&gt;Func&amp;lt;string, string&amp;gt; m1 = (Func&amp;lt;string, string&amp;gt;)m1dyn.CreateDelegate(typeof(Func&amp;lt;string, string&amp;gt;));&lt;br /&gt;&lt;br /&gt;DynamicMethod m2dyn = new DynamicMethod("m1", typeof(string), new[] { typeof(string) });&lt;br /&gt;var il2 = m2dyn.GetILGenerator();&lt;br /&gt;il2.Emit(OpCodes.Ldarg_0);&lt;br /&gt;il2.Emit(OpCodes.Call, m1dyn);&lt;br /&gt;il2.Emit(OpCodes.Ret);&lt;br /&gt;Func&amp;lt;string, string&amp;gt; m2 = (Func&amp;lt;string, string&amp;gt;)m2dyn.CreateDelegate(typeof(Func&amp;lt;string, string&amp;gt;));&lt;br /&gt;&lt;br /&gt;string a = m2("a");&lt;br /&gt;Console.WriteLine(a);&lt;br /&gt;}&lt;/span&gt;&lt;/string,&gt;&lt;/string,&gt;&lt;/string,&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5246533954472307929-8160006650027424978?l=anehir.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anehir.blogspot.com/feeds/8160006650027424978/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://anehir.blogspot.com/2010/09/c-call-dynamicmethod-within-another.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5246533954472307929/posts/default/8160006650027424978'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5246533954472307929/posts/default/8160006650027424978'/><link rel='alternate' type='text/html' href='http://anehir.blogspot.com/2010/09/c-call-dynamicmethod-within-another.html' title='C#: Call DynamicMethod within another DynamicMethod'/><author><name>Abdullah Nehir</name><uri>http://www.blogger.com/profile/16004788413432497231</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5246533954472307929.post-4492129731215675513</id><published>2010-02-09T01:26:00.000-08:00</published><updated>2010-02-12T03:54:03.569-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='wcf basichttpbinding windows security'/><title type='text'>WCF BasicHttpBinding and windows authentication on IIS 6.0</title><content type='html'>Recently I tried to host a WCF service on IIS 6.0 with basic http binding.&lt;br /&gt;I needed to authenticate users with windows security mode.&lt;br /&gt;&lt;br /&gt;I configured the WCF binding like below in the web.config file:&lt;br /&gt;&lt;br /&gt;&amp;lt;bindings&amp;gt;&lt;br /&gt;&amp;lt;basicHttpBinding&amp;gt;&lt;br /&gt;  &amp;lt;binding name="BasicHttpWindowsBinding"&amp;gt;&lt;br /&gt;    &amp;lt;security mode="TransportCredentialOnly"&amp;gt;&lt;br /&gt;      &amp;lt;transport clientCredentialType="&lt;span style="color: rgb(255, 0, 0);"&gt;Windows&lt;/span&gt;" /&amp;gt;&lt;br /&gt;    &amp;lt;/security&amp;gt;&lt;br /&gt;  &amp;lt;/binding&amp;gt;&lt;br /&gt;&amp;lt;/basicHttpBinding&amp;gt;&lt;br /&gt;&amp;lt;/bindings&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Although I configured IIS so that anonymous authentication is not allowed and windows authentication is required, I got this error when I opened the service page with internet explorer:&lt;br /&gt;&lt;br /&gt;System.NotSupportedException: security settings for this service require windows authentication but it is not enabled for the iis application that hosts this service&lt;br /&gt;&lt;br /&gt;Well, it was disappointing because both service configuration and the IIS configuration was configured for windows authentication mode.&lt;br /&gt;&lt;br /&gt;After a little struggle I found that basicHttpBinding's windows authentication is not supported by IIS 6.0.&lt;br /&gt;&lt;span style="color: rgb(153, 0, 0);"&gt;Instead &lt;/span&gt;&lt;span style="color: rgb(153, 0, 0);"&gt;security mode of the binding should be set to &lt;/span&gt;&lt;span style="font-weight: bold; color: rgb(153, 0, 0);"&gt;Ntlm &lt;/span&gt;&lt;span style="color: rgb(153, 0, 0);"&gt;and you have to &lt;span style="font-weight: bold;"&gt;allow&lt;/span&gt; &lt;span style="font-weight: bold;"&gt;anonymous authentication &lt;/span&gt;in the IIS site settings&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;Here is the complete config file:&lt;br /&gt;&lt;br /&gt;&amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt;&lt;br /&gt;&amp;lt;configuration&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;system.web&amp;gt;&lt;br /&gt;&amp;lt;compilation debug="true" /&amp;gt;&lt;br /&gt;&amp;lt;customErrors mode="Off" /&amp;gt;&lt;br /&gt;&amp;lt;authentication mode="Windows"&amp;gt;&lt;br /&gt;&amp;lt;/authentication&amp;gt;&lt;br /&gt;&amp;lt;authorization&amp;gt;&lt;br /&gt;&amp;lt;allow users="somedomain\someuser"/&amp;gt;&lt;br /&gt;&amp;lt;deny users="*"/&amp;gt;&lt;br /&gt;&amp;lt;/authorization&amp;gt;&lt;br /&gt;&amp;lt;/system.web&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;system.codedom&amp;gt;&lt;br /&gt;&amp;lt;compilers&amp;gt;&lt;br /&gt;&amp;lt;compiler language="c#;cs;csharp" extension=".cs" warningLevel="4" type="Microsoft.CSharp.CSharpCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"&amp;gt;&lt;br /&gt;  &amp;lt;providerOption name="CompilerVersion" value="v3.5" /&amp;gt;&lt;br /&gt;  &amp;lt;providerOption name="WarnAsError" value="false" /&amp;gt;&lt;br /&gt;&amp;lt;/compiler&amp;gt;&lt;br /&gt;&amp;lt;/compilers&amp;gt;&lt;br /&gt;&amp;lt;/system.codedom&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;system.webServer&amp;gt;&lt;br /&gt;&amp;lt;validation validateIntegratedModeConfiguration="false" /&amp;gt;&lt;br /&gt;&amp;lt;handlers&amp;gt;&lt;br /&gt;&amp;lt;add name="SvcFile" path="*.svc" verb="*" type="System.ServiceModel.Activation.HttpHandler" resourceType="Unspecified" preCondition="integratedMode" /&amp;gt;&lt;br /&gt;&amp;lt;/handlers&amp;gt;&lt;br /&gt;&amp;lt;directoryBrowse enabled="true" showFlags="Date, Time, Size, Extension, LongDate" /&amp;gt;&lt;br /&gt;&amp;lt;/system.webServer&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;system.serviceModel&amp;gt;&lt;br /&gt;&amp;lt;bindings&amp;gt;&lt;br /&gt;&amp;lt;basicHttpBinding&amp;gt;&lt;br /&gt;  &amp;lt;binding name="BasicHttpWindowsBinding"&amp;gt;&lt;br /&gt;    &amp;lt;security mode="TransportCredentialOnly"&amp;gt;&lt;br /&gt;      &amp;lt;transport clientCredentialType="&lt;span style="color: rgb(204, 0, 0);"&gt;Ntlm&lt;/span&gt;" /&amp;gt;&lt;br /&gt;    &amp;lt;/security&amp;gt;&lt;br /&gt;  &amp;lt;/binding&amp;gt;&lt;br /&gt;&amp;lt;/basicHttpBinding&amp;gt;&lt;br /&gt;&amp;lt;/bindings&amp;gt;&lt;br /&gt;&amp;lt;services&amp;gt;&lt;br /&gt;&amp;lt;service behaviorConfiguration="SomeServiceBehavior" name="SomeAssembly.SomeService"&amp;gt;&lt;br /&gt;  &amp;lt;endpoint binding="basicHttpBinding" bindingConfiguration="BasicHttpWindowsBinding" contract="SomeAssembly.ISomeService"&amp;gt;&lt;br /&gt;    &amp;lt;identity&amp;gt;&lt;br /&gt;      &amp;lt;dns value="localhost" /&amp;gt;&lt;br /&gt;    &amp;lt;/identity&amp;gt;&lt;br /&gt;  &amp;lt;/endpoint&amp;gt;&lt;br /&gt;  &amp;lt;endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange" /&amp;gt;&lt;br /&gt;  &amp;lt;host&amp;gt;&lt;br /&gt;    &amp;lt;baseAddresses&amp;gt;&lt;br /&gt;      &amp;lt;add baseAddress="https://localhost/SomeAssembly/ISomeService.svc" /&amp;gt;&lt;br /&gt;    &amp;lt;/baseAddresses&amp;gt;&lt;br /&gt;  &amp;lt;/host&amp;gt;&lt;br /&gt;&amp;lt;/service&amp;gt;&lt;br /&gt;&amp;lt;/services&amp;gt;&lt;br /&gt;&amp;lt;behaviors&amp;gt;&lt;br /&gt;&amp;lt;serviceBehaviors&amp;gt;&lt;br /&gt;  &amp;lt;behavior name="SomeServiceBehavior"&amp;gt;&lt;br /&gt;    &amp;lt;serviceMetadata httpGetEnabled="True"/&amp;gt;&lt;br /&gt;    &amp;lt;serviceDebug includeExceptionDetailInFaults="True" /&amp;gt;&lt;br /&gt;  &amp;lt;/behavior&amp;gt;&lt;br /&gt;&amp;lt;/serviceBehaviors&amp;gt;&lt;br /&gt;&amp;lt;/behaviors&amp;gt;&lt;br /&gt;&amp;lt;/system.serviceModel&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;/configuration&amp;gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5246533954472307929-4492129731215675513?l=anehir.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anehir.blogspot.com/feeds/4492129731215675513/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://anehir.blogspot.com/2010/02/wcf-basichttpbinding-and-windows.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5246533954472307929/posts/default/4492129731215675513'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5246533954472307929/posts/default/4492129731215675513'/><link rel='alternate' type='text/html' href='http://anehir.blogspot.com/2010/02/wcf-basichttpbinding-and-windows.html' title='WCF BasicHttpBinding and windows authentication on IIS 6.0'/><author><name>Abdullah Nehir</name><uri>http://www.blogger.com/profile/16004788413432497231</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5246533954472307929.post-8652828939449954684</id><published>2009-11-06T04:14:00.000-08:00</published><updated>2009-12-01T04:06:54.795-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='tfs view history error'/><title type='text'>No history entries were found for the item and version combination specified</title><content type='html'>This is a message when I tried to view the history of a folder on TFS.&lt;br /&gt;&lt;br /&gt;I googled the message and only a few exact matches came out. First two was useless. I was terrified for an instance, but this blog entry saved me :&lt;br /&gt;&lt;br /&gt;&lt;a href="http://team-foundation-server.blogspot.com/2007/07/no-history-entries-were-found-for-item.html"&gt;http://team-foundation-server.blogspot.com/2007/07/no-history-entries-were-found-for-item.html&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;The problem was that I had no permissions on the folder although I was an administrator. I could never remember to check the securities.&lt;br /&gt;&lt;br /&gt;When I checked it I saw that the folder was not inheriting permissions. After inheriting permissions I could view the history of the folder.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5246533954472307929-8652828939449954684?l=anehir.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anehir.blogspot.com/feeds/8652828939449954684/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://anehir.blogspot.com/2009/11/no-history-entries-were-found-for-item.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5246533954472307929/posts/default/8652828939449954684'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5246533954472307929/posts/default/8652828939449954684'/><link rel='alternate' type='text/html' href='http://anehir.blogspot.com/2009/11/no-history-entries-were-found-for-item.html' title='No history entries were found for the item and version combination specified'/><author><name>Abdullah Nehir</name><uri>http://www.blogger.com/profile/16004788413432497231</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5246533954472307929.post-3234434810686983831</id><published>2009-11-04T03:19:00.000-08:00</published><updated>2011-11-03T10:29:55.481-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='tfs'/><category scheme='http://www.blogger.com/atom/ns#' term='migrate to tfs'/><category scheme='http://www.blogger.com/atom/ns#' term='migrate from vss to tfs'/><category scheme='http://www.blogger.com/atom/ns#' term='branching strategy'/><title type='text'>Migrating from VSS to TFS</title><content type='html'>Beware!!! This is not a technical article about how to migrate VSS to TFS. &lt;br /&gt;This is a story about my experience of migrating to TFS.&lt;br /&gt;&lt;br /&gt;When we first met with TFS we were using Visual Source Safe 6.0.&lt;br /&gt;&lt;br /&gt;Advisors from Microsoft came and introduced the brand new source version control system of Mirosoft, TFS. Future of the source version controls was TFS. Moreover TFS was not just another source version control system. We could even use TFS to manage projects instead of our own project management system. It also had the shelve option when you are leaving work at night. TFS brought everything we needed. They urged us to migrate to TFS because Microsoft itself was migrating to TFS. Because it was newer and better, we should quit VSS and use TFS instead.&lt;br /&gt;&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;One of my colleagues, &lt;a href="http://blog.gezdirici.net/yakup/"&gt;Yakup&lt;/a&gt;, also told us that he used TFS in his previous company. They were pleased with its incremental get ability. For larger projects it was an ache in the stomach to get the latest version of your project in the morning. VSS was checking every file and calculating checksums in order to decide if they were the latest versions. It was taking too much time. TFS was keeping history of your workspace to decide if you have the latest version or not. It was much faster than VSS to get the latest version of a project.&lt;br /&gt;&lt;br /&gt;As a punishment to his act of recommending TFS to us, Yakup was chosen to install TFS :-)&lt;br /&gt;&lt;br /&gt;After a humble installation (on a poor virtual machine)  we started using TFS. Its performance was satisfying. Our project managers investigated project management aspects of TFS but they were not satisfied with them because TFS was not able to keep how much time we spent for each task/bug. They had to report to higher administration of how much a project costed in terms of our salaries :-)&lt;br /&gt;&lt;br /&gt;Still we decided to use TFS because of a few reasons. Microsoft advised us to use it, it was new, software companies were going to use it and we did not want to be backwards amongst others, and TFS had the ability of incremental get.&lt;br /&gt;&lt;br /&gt;We had two branches, Development and Production. We were developing new projects in Development branch. After finishing a project we were checking out Production branch, moving newly added codes from Development to Production with the help of a folder comparison tool, and finally we were checking in Production branch completely.&lt;br /&gt;&lt;br /&gt;Parallel development on the same project still was a big problem. Developers were using each others methods in the Development branch. But some of the methods they use for a feature, say feature X, were happening to be implemented for another feature originally, say feature Y, and because feature Y was still being developed those methods did not exist in the Production branch. Therefore deployment date of feature X was being postponed to the deployment date of feature Y. There were delays on project plans just because we were not able to calculate such usages of other features.&lt;br /&gt;&lt;br /&gt;Finally, we realized that TFS was not a brand new source version control system. It solved none of our big problems. We were still having difficulties in parallel development.&lt;br /&gt;&lt;br /&gt;In fact we were not aware of the power of TFS, branching and merging ability. The way we used TFS was just like the way we used VSS.&lt;br /&gt;&lt;br /&gt;The main purpose of this writing is to make you aware of this single mistake: we did not try to learn conceptual facts about source version control systems. We were just happy with the old VSS. We did not realize the need of some other development methodology for our large scale projects for which parallel development is unavoidable.&lt;br /&gt;&lt;br /&gt;In my example, the software project was the whole banking system of a bank. As you may easily guess, all the products of a bank needs software development behind. Competition between banks forces them to present new products to their customers continually in order to keep customers loyal to themselves. Each department of a bank invents new products every once in a while and requests software supply for those new inventions. Therefore huge software projects for banking systems need continuous development to present new products one after one (new account types, new bill payment systems, new investment methods, new credit cards...)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;to be continued...&lt;br /&gt;continuing (after a long while)...&lt;br /&gt;&lt;br /&gt;Our software development pattern is like this: we have a number of products, and we continually add new features to them. Version release rate is once a month, but bug fix release intervals are shorter.&lt;br /&gt;&lt;br /&gt;Thus we adopted such a branching structure:&lt;br /&gt;For every feature request or bug fix, we start a new branch from code repository. Number of branches became, well..., a little too many :-)&lt;br /&gt;In order to manage these branches, in such big numbers, we developed a command line tool using .net APIs of TFS. &lt;br /&gt;&lt;br /&gt;Although we have so much branches, we do not encounter merge conflicts that much. This is mostly because a business department makes one or two requests for a certain amount of time (say a year). Plus not all products' codes need to change for one feature. Thus merge conflicts occur occasionally.&lt;br /&gt;&lt;br /&gt;Additionally, branching for every request provides us flexibility in releasing features. We can release a feature immediately after development finishes or at a later time. We can even freeze the development if the business department wishes. Newly developed codes are not lost (they stay in the branch) and they do not interfere with other developments (we did not merge the branch to the trunk). If we want to release a feature, we simply merge the branch to the trunk.&lt;br /&gt;&lt;br /&gt;We also used the build engine of TFS to check the health of our codes. After every checkin, we start builds and do code analysis, and we also report analysis results to the developers. If a build fails, we alarm all the team, not just the developer who checked in the code. Because the code they are going to get from TFS is going to be dirty, they should not get the latest version until somebody makes sure that the code on the server builds.&lt;br /&gt;&lt;br /&gt;In summary, if you are not familiar with source version control concepts, and want to migrate from VSS to any modern source version control tool, not just TFS. I suggest you to search for branching strategies in accordance with your development model.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5246533954472307929-3234434810686983831?l=anehir.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anehir.blogspot.com/feeds/3234434810686983831/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://anehir.blogspot.com/2009/11/migrating-from-vss-to-tfs.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5246533954472307929/posts/default/3234434810686983831'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5246533954472307929/posts/default/3234434810686983831'/><link rel='alternate' type='text/html' href='http://anehir.blogspot.com/2009/11/migrating-from-vss-to-tfs.html' title='Migrating from VSS to TFS'/><author><name>Abdullah Nehir</name><uri>http://www.blogger.com/profile/16004788413432497231</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5246533954472307929.post-6365770189180440407</id><published>2009-11-03T03:26:00.001-08:00</published><updated>2009-11-03T03:26:56.636-08:00</updated><title type='text'>Get Database Schema</title><content type='html'>If you want to list the tables of a database and columns of a table you may use the "GetSchema" method of System.Data.Common.DbConnection class.&lt;br /&gt;It works on both MS Sql Server 200 and 2005. I did not try on other servers.&lt;br /&gt;&lt;br /&gt;Sample Code&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;"&gt;DbConnection con = new OleDbConnection(connetionString);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;"&gt;DataTable tables = &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;"&gt;      con.GetSchema("TABLES", new string[] {null, null, null, "BASE TABLE" });&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;"&gt;DataTable columns = &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;"&gt;      con.GetSchema("COLUMNS", new string[] {"CustomerTable", null, null });&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5246533954472307929-6365770189180440407?l=anehir.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anehir.blogspot.com/feeds/6365770189180440407/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://anehir.blogspot.com/2009/11/get-database-schema.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5246533954472307929/posts/default/6365770189180440407'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5246533954472307929/posts/default/6365770189180440407'/><link rel='alternate' type='text/html' href='http://anehir.blogspot.com/2009/11/get-database-schema.html' title='Get Database Schema'/><author><name>Abdullah Nehir</name><uri>http://www.blogger.com/profile/16004788413432497231</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5246533954472307929.post-8919726355077497127</id><published>2008-01-05T03:29:00.000-08:00</published><updated>2009-11-06T05:53:45.029-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='sorteddictionary vs dictionary; dictionary vs sorteddictionary'/><category scheme='http://www.blogger.com/atom/ns#' term='dictionary performance'/><title type='text'>Dictionary Performance</title><content type='html'>&lt;div&gt;I tested performances of these classes :&lt;br /&gt;&lt;br /&gt;A) Key-value keepers&lt;br /&gt;- Dictionary&lt;tkey,&gt;&lt;br /&gt;- SortedDictionary&lt;tkey,&gt;&lt;br /&gt;- SortedList&lt;tkey,&gt;&lt;br /&gt;B) Value keepers&lt;br /&gt;- List&lt;t&gt;&lt;br /&gt;- HashSet&lt;t&gt;&lt;br /&gt;- List&lt;t&gt; (Sorted and binary searched)&lt;br /&gt;&lt;br /&gt;I inserted a number of random numbers to these classes and searched for numbers afterwards.&lt;br /&gt;Below results show the average of 100 tests.&lt;br /&gt;&lt;br /&gt;&lt;/t&gt;&lt;/t&gt;&lt;/t&gt;&lt;/tkey,&gt;&lt;/tkey,&gt;&lt;/tkey,&gt;&lt;/div&gt;&lt;br /&gt;&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="overflow: auto; height: 300px;"&gt;&lt;br /&gt;&lt;table borderstyle="solid" border="1" bordercolor="black" width="1080"&gt;&lt;tbody&gt;&lt;tr style="height: 15pt;" height="20"&gt;&lt;td colspan="2" height="20" width="202"&gt;Item Count&lt;/td&gt;&lt;td colspan="2" width="145"&gt;5&lt;/td&gt;&lt;td colspan="2" width="145"&gt;10&lt;/td&gt;&lt;td colspan="2" width="145"&gt;50&lt;/td&gt;&lt;td colspan="2" width="145"&gt;100&lt;/td&gt;&lt;td colspan="2" width="145"&gt;1,000&lt;/td&gt;&lt;td colspan="2" width="153"&gt;10,000&lt;/td&gt;&lt;/tr&gt;&lt;tr style="height: 15pt;" height="20"&gt;&lt;td colspan="2" height="20"&gt;Operation&lt;/td&gt;&lt;td&gt;Insert (µs)&lt;/td&gt;&lt;td&gt;Search (µs)&lt;/td&gt;&lt;td&gt;Insert (µs)&lt;/td&gt;&lt;td&gt;Search (µs)&lt;/td&gt;&lt;td&gt;Insert (µs)&lt;/td&gt;&lt;td&gt;Search (µs)&lt;/td&gt;&lt;td&gt;Insert (µs)&lt;/td&gt;&lt;td&gt;Search (µs)&lt;/td&gt;&lt;td&gt;Insert (µs)&lt;/td&gt;&lt;td&gt;Search (µs)&lt;/td&gt;&lt;td&gt;Insert (µs)&lt;/td&gt;&lt;td&gt;Search (µs)&lt;/td&gt;&lt;/tr&gt;&lt;tr style="height: 15pt;" height="20"&gt;&lt;td rowspan="3" height="60" width="90"&gt;Key-Value Holders(string - string)&lt;/td&gt;&lt;td class="style8"&gt;Dictionary&lt;/td&gt;&lt;td align="right"&gt;3.97&lt;/td&gt;&lt;td align="right"&gt;12.81&lt;/td&gt;&lt;td align="right"&gt;4.33&lt;/td&gt;&lt;td align="right"&gt;11.20&lt;/td&gt;&lt;td align="right"&gt;8.75&lt;/td&gt;&lt;td align="right"&gt;15.10&lt;/td&gt;&lt;td align="right"&gt;12.78&lt;/td&gt;&lt;td align="right"&gt;20.04&lt;/td&gt;&lt;td align="right"&gt;111.49&lt;/td&gt;&lt;td align="right"&gt;116.07&lt;/td&gt;&lt;td align="right"&gt;1,037.95&lt;/td&gt;&lt;td align="right"&gt;1,082.61&lt;/td&gt;&lt;/tr&gt;&lt;tr style="height: 15pt;" height="20"&gt;&lt;td height="20"&gt;SortedDictionary&lt;/td&gt;&lt;td align="right"&gt;2.27&lt;/td&gt;&lt;td align="right"&gt;2.59&lt;/td&gt;&lt;td align="right"&gt;6.95&lt;/td&gt;&lt;td align="right"&gt;6.30&lt;/td&gt;&lt;td align="right"&gt;65.43&lt;/td&gt;&lt;td align="right"&gt;48.79&lt;/td&gt;&lt;td align="right"&gt;131.48&lt;/td&gt;&lt;td align="right"&gt;134.95&lt;/td&gt;&lt;td align="right"&gt;2,133.92&lt;/td&gt;&lt;td align="right"&gt;1,936.47&lt;/td&gt;&lt;td align="right"&gt;29,699.97&lt;/td&gt;&lt;td align="right"&gt;27,179.20&lt;/td&gt;&lt;/tr&gt;&lt;tr style="height: 15pt;" height="20"&gt;&lt;td height="20"&gt;SortedList&lt;/td&gt;&lt;td align="right"&gt;2.67&lt;/td&gt;&lt;td align="right"&gt;3.58&lt;/td&gt;&lt;td align="right"&gt;6.59&lt;/td&gt;&lt;td align="right"&gt;6.75&lt;/td&gt;&lt;td align="right"&gt;82.51&lt;/td&gt;&lt;td align="right"&gt;62.68&lt;/td&gt;&lt;td align="right"&gt;116.64&lt;/td&gt;&lt;td align="right"&gt;115.66&lt;/td&gt;&lt;td align="right"&gt;2,747.47&lt;/td&gt;&lt;td align="right"&gt;1,772.13&lt;/td&gt;&lt;td align="right"&gt;115,544.27&lt;/td&gt;&lt;td align="right"&gt;24,216.48&lt;/td&gt;&lt;/tr&gt;&lt;tr style="height: 15pt;" height="20"&gt;&lt;td rowspan="3" height="60" width="90"&gt;Value Holders(string)&lt;/td&gt;&lt;td class="style12"&gt;List&lt;/td&gt;&lt;td align="right"&gt;2.46&lt;/td&gt;&lt;td align="right"&gt;12.04&lt;/td&gt;&lt;td align="right"&gt;2.60&lt;/td&gt;&lt;td align="right"&gt;11.89&lt;/td&gt;&lt;td align="right"&gt;3.61&lt;/td&gt;&lt;td align="right"&gt;42.94&lt;/td&gt;&lt;td align="right"&gt;4.62&lt;/td&gt;&lt;td align="right"&gt;141.05&lt;/td&gt;&lt;td align="right"&gt;33.44&lt;/td&gt;&lt;td align="right"&gt;11,644.09&lt;/td&gt;&lt;td align="right"&gt;263.98&lt;/td&gt;&lt;td align="right"&gt;1,166,795.60&lt;/td&gt;&lt;/tr&gt;&lt;tr style="height: 15pt;" height="20"&gt;&lt;td height="20"&gt;HashSet&lt;/td&gt;&lt;td align="right"&gt;0.84&lt;/td&gt;&lt;td align="right"&gt;1.67&lt;/td&gt;&lt;td align="right"&gt;1.33&lt;/td&gt;&lt;td align="right"&gt;1.70&lt;/td&gt;&lt;td align="right"&gt;6.53&lt;/td&gt;&lt;td align="right"&gt;5.93&lt;/td&gt;&lt;td align="right"&gt;9.76&lt;/td&gt;&lt;td align="right"&gt;10.84&lt;/td&gt;&lt;td align="right"&gt;78.95&lt;/td&gt;&lt;td align="right"&gt;103.39&lt;/td&gt;&lt;td align="right"&gt;914.99&lt;/td&gt;&lt;td align="right"&gt;1,085.26&lt;/td&gt;&lt;/tr&gt;&lt;tr style="height: 15pt;" height="20"&gt;&lt;td height="20"&gt;List(Sorted)&lt;/td&gt;&lt;td align="right"&gt;9.41&lt;/td&gt;&lt;td align="right"&gt;7.37&lt;/td&gt;&lt;td align="right"&gt;18.38&lt;/td&gt;&lt;td align="right"&gt;11.42&lt;/td&gt;&lt;td align="right"&gt;95.63&lt;/td&gt;&lt;td align="right"&gt;61.45&lt;/td&gt;&lt;td align="right"&gt;184.43&lt;/td&gt;&lt;td align="right"&gt;112.95&lt;/td&gt;&lt;td align="right"&gt;2,353.52&lt;/td&gt;&lt;td align="right"&gt;1,687.84&lt;/td&gt;&lt;td align="right"&gt;31,121.19&lt;/td&gt;&lt;td align="right"&gt;23,464.25&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;a href="http://bp1.blogger.com/_ZzCUaTEqTEE/SCRa0LhjHII/AAAAAAAAAAc/BcVI53PlZ4Q/s1600-h/Insert+performance.JPG"&gt;&lt;img id="BLOGGER_PHOTO_ID_5198379722385595522" style="margin: 0px auto 10px; display: block; text-align: center;" alt="" src="http://bp1.blogger.com/_ZzCUaTEqTEE/SCRa0LhjHII/AAAAAAAAAAc/BcVI53PlZ4Q/s400/Insert+performance.JPG" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://bp2.blogger.com/_ZzCUaTEqTEE/SCRa0bhjHJI/AAAAAAAAAAk/TMHxYBA5RWM/s1600-h/search+performance.JPG"&gt;&lt;img id="BLOGGER_PHOTO_ID_5198379726680562834" style="margin: 0px auto 10px; display: block; text-align: center;" alt="" src="http://bp2.blogger.com/_ZzCUaTEqTEE/SCRa0bhjHJI/AAAAAAAAAAk/TMHxYBA5RWM/s400/search+performance.JPG" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;For value holder classes :&lt;br /&gt;- ICollection.Add(item) method is used to insert items.&lt;br /&gt;- ICollection.Contains(item) method is used to search for items&lt;br /&gt;&lt;br /&gt;For key-value holder classes&lt;br /&gt;- IDictionary&lt;tkey,&gt;.Add(key, item) method is used to insert items.&lt;br /&gt;- IDictionary&lt;tkey,&gt;.ContainsKey(key) method is used to search for items.&lt;/tkey,&gt;&lt;/tkey,&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;RESULTS&lt;/p&gt;&lt;br /&gt;&lt;p&gt;If you want to keep key-value pairs, you obviously want to do search business.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;If you keep less than 10 items of key-value pairs, search performance of sorted dictionary is the best. Above 10 items dictionary beats others in search business. &lt;/p&gt;&lt;br /&gt;&lt;p&gt;If you want to keep only values, there are two businesses : transferring the data, or searching the data. &lt;/p&gt;&lt;br /&gt;&lt;p&gt;If you are to insert the items to a list, transfer them to some other method, and in theat method you loop through all items, List&lt;t&gt; is the best tool. &lt;/t&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;If you are to insert items to some list and to do checks of existence on that list, HashSet&lt;t&gt; is the best tool. &lt;/t&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;Edit : You may find the code here :&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;using System;&lt;br /&gt;using System.Collections.Generic;&lt;br /&gt;using System.Data;&lt;br /&gt;using System.Data.Common;&lt;br /&gt;using System.Data.SqlClient;&lt;br /&gt;using System.Diagnostics;&lt;br /&gt;using System.Linq;&lt;br /&gt;using System.Runtime.InteropServices;&lt;br /&gt;using System.Text.RegularExpressions;&lt;br /&gt;using System.Threading;&lt;br /&gt;using System.Collections;&lt;br /&gt;&lt;br /&gt;namespace ConsoleApp&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;    public static class Program2&lt;br /&gt;    {&lt;br /&gt;&lt;br /&gt;        private static void DebugWriteLine(string message, int testCount, VoidMethod method)&lt;br /&gt;        {&lt;br /&gt;            Stopwatch t2 = new Stopwatch();&lt;br /&gt;            t2.Start();&lt;br /&gt;            for (int j = 0; j &amp;lt; testCount; j++)&lt;br /&gt;            {&lt;br /&gt;                method();&lt;br /&gt;            }&lt;br /&gt;            t2.Stop();&lt;br /&gt;            Console.WriteLine(message + "\t" + ((t2.Elapsed.TotalSeconds * 1000000) / testCount).ToString("0.###############"));&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        private static void TestDictionaryInsert&amp;lt;T&amp;gt;(T dict, List&amp;lt;string&amp;gt; items) where T : IDictionary&amp;lt;string, string&amp;gt;&lt;br /&gt;        {&lt;br /&gt;            foreach (var item in items)&lt;br /&gt;            {&lt;br /&gt;                dict.Add(item, item);&lt;br /&gt;            }&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        private static void TestDictionarySearch&amp;lt;T&amp;gt;(T dict, List&amp;lt;string&amp;gt; items) where T : IDictionary&amp;lt;string, string&amp;gt;&lt;br /&gt;        {&lt;br /&gt;            foreach (var item in items)&lt;br /&gt;            {&lt;br /&gt;                dict.ContainsKey(item);&lt;br /&gt;            }&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        private static void TestListInsert&amp;lt;T&amp;gt;(T list, List&amp;lt;string&amp;gt; items) where T : ICollection&amp;lt;string&amp;gt;&lt;br /&gt;        {&lt;br /&gt;            foreach (var item in items)&lt;br /&gt;            {&lt;br /&gt;                list.Add(item);&lt;br /&gt;            }&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        private static void TestListSearch&amp;lt;T&amp;gt;(T list, List&amp;lt;string&amp;gt; items) where T : ICollection&amp;lt;string&amp;gt;&lt;br /&gt;        {&lt;br /&gt;            foreach (var item in items)&lt;br /&gt;            {&lt;br /&gt;                list.Contains(item);&lt;br /&gt;            }&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        static void Main(string[] args)&lt;br /&gt;        {&lt;br /&gt;            TestPerformanceOfDataHolders(100);&lt;br /&gt;            Console.ReadKey();&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        public static void TestPerformanceOfDataHolders(int itemCount)&lt;br /&gt;        {&lt;br /&gt;            var items = new List&amp;lt;string&amp;gt;(itemCount);&lt;br /&gt;&lt;br /&gt;            Random r = new Random((int)DateTime.Now.Ticks);&lt;br /&gt;            int random = 0;&lt;br /&gt;            for (int i = 0; i &amp;lt; itemCount; i++)&lt;br /&gt;            {&lt;br /&gt;                do&lt;br /&gt;                {&lt;br /&gt;                    random = r.Next();&lt;br /&gt;                } while (items.Contains(random.ToString()));&lt;br /&gt;                items.Add(random.ToString());&lt;br /&gt;            }&lt;br /&gt;&lt;br /&gt;            List&amp;lt;IDictionary&amp;lt;string, string&amp;gt;&amp;gt; dictList = new List&amp;lt;IDictionary&amp;lt;string, string&amp;gt;&amp;gt;();&lt;br /&gt;            dictList.Add(new Dictionary&amp;lt;string, string&amp;gt;());&lt;br /&gt;            dictList.Add(new SortedDictionary&amp;lt;string, string&amp;gt;());&lt;br /&gt;            dictList.Add(new SortedList&amp;lt;string, string&amp;gt;());&lt;br /&gt;&lt;br /&gt;            List&amp;lt;ICollection&amp;lt;string&amp;gt;&amp;gt; colList = new List&amp;lt;ICollection&amp;lt;string&amp;gt;&amp;gt;();&lt;br /&gt;            colList.Add(new List&amp;lt;string&amp;gt;());&lt;br /&gt;            colList.Add(new HashSet&amp;lt;string&amp;gt;());&lt;br /&gt;&lt;br /&gt;            var sortedList = new List&amp;lt;string&amp;gt;();&lt;br /&gt;&lt;br /&gt;            foreach (var item in dictList)&lt;br /&gt;            {&lt;br /&gt;                TestDictionaryInsert(item, items);&lt;br /&gt;            }&lt;br /&gt;&lt;br /&gt;            foreach (var item in colList)&lt;br /&gt;            {&lt;br /&gt;                TestListInsert(item, items);&lt;br /&gt;            }&lt;br /&gt;&lt;br /&gt;            sortedList.AddRange(items);&lt;br /&gt;            sortedList.Sort();&lt;br /&gt;&lt;br /&gt;            const int testCount = 100;&lt;br /&gt;            foreach (var item in dictList)&lt;br /&gt;            {&lt;br /&gt;                DebugWriteLine(item.GetType().Name + " Insert", testCount, delegate&lt;br /&gt;                {&lt;br /&gt;                    item.Clear();&lt;br /&gt;                    TestDictionaryInsert(item, items);&lt;br /&gt;                });&lt;br /&gt;            }&lt;br /&gt;&lt;br /&gt;            foreach (var item in colList)&lt;br /&gt;            {&lt;br /&gt;                DebugWriteLine(item.GetType().Name + " Insert", testCount, delegate&lt;br /&gt;                {&lt;br /&gt;                    item.Clear();&lt;br /&gt;                    TestListInsert(item, items);&lt;br /&gt;                });&lt;br /&gt;            }&lt;br /&gt;&lt;br /&gt;            DebugWriteLine("List(Sorted) Insert", testCount, delegate&lt;br /&gt;            {&lt;br /&gt;                sortedList.Clear();&lt;br /&gt;                foreach (var item in items)&lt;br /&gt;                {&lt;br /&gt;                    sortedList.Add(item);&lt;br /&gt;                }&lt;br /&gt;                sortedList.Sort();&lt;br /&gt;            });&lt;br /&gt;&lt;br /&gt;            foreach (var item in dictList)&lt;br /&gt;            {&lt;br /&gt;                DebugWriteLine(item.GetType().Name + " Search", testCount, delegate&lt;br /&gt;                {&lt;br /&gt;                    TestDictionarySearch(item, items);&lt;br /&gt;                });&lt;br /&gt;            }&lt;br /&gt;&lt;br /&gt;            foreach (var item in colList)&lt;br /&gt;            {&lt;br /&gt;                DebugWriteLine(item.GetType().Name + " Search", testCount, delegate&lt;br /&gt;                {&lt;br /&gt;                    TestListSearch(item, items);&lt;br /&gt;                });&lt;br /&gt;            }&lt;br /&gt;&lt;br /&gt;            DebugWriteLine("List(Sorted) Search", testCount, delegate&lt;br /&gt;            {&lt;br /&gt;                foreach (var item in items)&lt;br /&gt;                {&lt;br /&gt;                    sortedList.BinarySearch(item);&lt;br /&gt;                }&lt;br /&gt;            });&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;}&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5246533954472307929-8919726355077497127?l=anehir.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anehir.blogspot.com/feeds/8919726355077497127/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://anehir.blogspot.com/2009/11/dictionary-performance.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5246533954472307929/posts/default/8919726355077497127'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5246533954472307929/posts/default/8919726355077497127'/><link rel='alternate' type='text/html' href='http://anehir.blogspot.com/2009/11/dictionary-performance.html' title='Dictionary Performance'/><author><name>Abdullah Nehir</name><uri>http://www.blogger.com/profile/16004788413432497231</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://bp1.blogger.com/_ZzCUaTEqTEE/SCRa0LhjHII/AAAAAAAAAAc/BcVI53PlZ4Q/s72-c/Insert+performance.JPG' height='72' width='72'/><thr:total>0</thr:total></entry></feed>
