<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><!--RSS generated by Windows SharePoint Services V3 RSS Generator on 5/28/2012 10:08:03 PM--><rss xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0"><channel><title>SharePoint Blog - René Hézser</title><link>http://www.hezser.de/blog</link><description>RSS-Feed des Blogs von René Hézser</description><copyright>info@hezser.de (René Hézser)</copyright><managingEditor>info@hezser.de (René Hézser)</managingEditor><webMaster>info@hezser.de (René Hézser)</webMaster><lastBuildDate>Mon, 28 May 2012 20:08:02 GMT</lastBuildDate><generator>SharePoint CKS:EBE</generator><ttl>60</ttl><image><title>SharePoint Blog - René Hézser</title><url>http://www.hezser.de/images/wallace.gif</url><link>http://www.hezser.de/blog</link></image><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/ReneHezser" /><feedburner:info uri="renehezser" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><feedburner:feedFlare href="http://fusion.google.com/add?feedurl=http%3A%2F%2Ffeeds.feedburner.com%2FReneHezser" src="http://buttons.googlesyndication.com/fusion/add.gif">Subscribe with Google</feedburner:feedFlare><feedburner:feedFlare href="http://www.live.com/?add=http%3A%2F%2Ffeeds.feedburner.com%2FReneHezser" src="http://tkfiles.storage.msn.com/x1piYkpqHC_35nIp1gLE68-wvzLZO8iXl_JMledmJQXP-XTBOLfmQv4zhj4MhcWEJh_GtoBIiAl1Mjh-ndp9k47If7hTaFno0mxW9_i3p_5qQw">Subscribe with Live.com</feedburner:feedFlare><feedburner:feedFlare href="http://www.addtoany.com/?linkname=SharePoint%20Blog%20-%20Ren%C3%A9%20H%C3%A9zser&amp;linkurl=http%3A%2F%2Ffeeds.feedburner.com%2FReneHezser&amp;type=feed" src="http://www.addtoany.com/addfr-b.gif">Add to Any Feed Reader</feedburner:feedFlare><item><title>Site Availability (Update)</title><link>http://feedproxy.google.com/~r/ReneHezser/~3/i2n6nzeh84Q/site-availability.aspx</link><guid isPermaLink="False">/blog/archive/2012/05/23/site-availability.aspx</guid><description>&lt;div class="ExternalClassB65EA4DE745143E7AE6329588B44BE0C"&gt;&lt;p&gt;Tomorrow (May 24th) I will switch to a new telephone provider.&lt;/p&gt;  &lt;p&gt;My website will not be available for a while…&lt;/p&gt;  &lt;p&gt;Update:&lt;/p&gt;  &lt;p&gt;After completely messing up by not working on the change, my telephone line is working again…&lt;/p&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/ReneHezser/~4/i2n6nzeh84Q" height="1" width="1"/&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">René Hézser</dc:creator><pubDate>Wed, 23 May 2012 10:29:25 GMT</pubDate><category domain="http://www.hezser.de/blog/archive/tags/Sonstiges/default.aspx">Sonstiges</category><feedburner:origLink>http://www.hezser.de/blog/archive/2012/05/23/site-availability.aspx</feedburner:origLink></item><item><title>Error in SharePoint Search</title><link>http://feedproxy.google.com/~r/ReneHezser/~3/Lwf3_fq-Vgs/error-in-sharepoint-search.aspx</link><guid isPermaLink="False">/blog/archive/2012/05/02/error-in-sharepoint-search.aspx</guid><description>&lt;div class="ExternalClassC28DE78544674A7DB7A732B488432EF0"&gt;&lt;p&gt;I’ve had the error message “The SharePoint item being crawled returned an error when requesting data from the web service.   (0x80042616)” when I tried to crawl a SharePoint WebApplication. The search crawler account had access to a site by a WebApplication policy. But somehow, that didn’t work.&lt;/p&gt;  &lt;p&gt;After removing and re-adding the account policy on the WebApplication, the search crawled my content again.&lt;/p&gt;  &lt;p&gt;Hopefully this post can help others as well.&lt;/p&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/ReneHezser/~4/Lwf3_fq-Vgs" height="1" width="1"/&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">René Hézser</dc:creator><pubDate>Wed, 02 May 2012 12:25:30 GMT</pubDate><category domain="http://www.hezser.de/blog/archive/tags/SharePoint/default.aspx">SharePoint</category><feedburner:origLink>http://www.hezser.de/blog/archive/2012/05/02/error-in-sharepoint-search.aspx</feedburner:origLink></item><item><title>Execute code in multiple threads (even with SharePoint)</title><link>http://feedproxy.google.com/~r/ReneHezser/~3/VwWiDvsdfmQ/execute-code-in-multiple-threads-even-with-sharepoint.aspx</link><guid isPermaLink="False">/blog/archive/2012/04/28/execute-code-in-multiple-threads-even-with-sharepoint.aspx</guid><description>&lt;div class="ExternalClass039FEEB502C84A9A89920DD273AAB072"&gt;&lt;p&gt;Since SharePoint 2010 uses .NET 3.5, you can not use the fancy new functions from .NET 4 &lt;img style="border-bottom-style:none;border-left-style:none;border-top-style:none;border-right-style:none" class="wlEmoticon wlEmoticon-sadsmile" alt="Sad smile" src="http://www.hezser.de/blog/Media/Windows-Live-Writer/Execute-code-in-multiple-threads_10538/wlEmoticon-sadsmile_2.png"&gt;&lt;/p&gt;  &lt;p&gt;So if we need e.g. multi-threaded execution of code, we’ll need to write the code ourselves. But, as you can see, this really isn’t so hard. The basic idea behind this solution of executing code parallel in threads, is that you have an IEnumerable&amp;lt;T&amp;gt; of some kind. This can be a List, or any other IEnumerable.&lt;/p&gt;  &lt;p&gt;So let us for example take a list of Guids, which are the IDs of all SPWebs in a SiteCollection. Then we are iterating each web, and write the itemCount of all lists to the Console.&lt;/p&gt;  &lt;div style="padding-bottom:0px;margin:0px;padding-left:0px;padding-right:0px;display:inline;float:none;padding-top:0px" id="scid:57F11A72-B0E5-49c7-9094-E3A15BD5B5E6:4319446b-e6c2-473f-ac6b-8bc79a677c66" class="wlWriterEditableSmartContent"&gt;&lt;pre style="background-color:#FFFFFF;overflow:auto"&gt;&lt;span style="color:#0000FF"&gt;class&lt;/span&gt;&lt;span style="color:#000000"&gt; ParallelExecutionTest
{
   &lt;/span&gt;&lt;span style="color:#0000FF"&gt;private&lt;/span&gt;&lt;span style="color:#000000"&gt; &lt;/span&gt;&lt;span style="color:#0000FF"&gt;static&lt;/span&gt;&lt;span style="color:#000000"&gt; &lt;/span&gt;&lt;span style="color:#0000FF"&gt;int&lt;/span&gt;&lt;span style="color:#000000"&gt; _overallItemCount;
   &lt;/span&gt;&lt;span style="color:#0000FF"&gt;private&lt;/span&gt;&lt;span style="color:#000000"&gt; &lt;/span&gt;&lt;span style="color:#0000FF"&gt;static&lt;/span&gt;&lt;span style="color:#000000"&gt; &lt;/span&gt;&lt;span style="color:#0000FF"&gt;readonly&lt;/span&gt;&lt;span style="color:#000000"&gt; &lt;/span&gt;&lt;span style="color:#0000FF"&gt;object&lt;/span&gt;&lt;span style="color:#000000"&gt; Lock &lt;/span&gt;&lt;span style="color:#000000"&gt;=&lt;/span&gt;&lt;span style="color:#000000"&gt; &lt;/span&gt;&lt;span style="color:#0000FF"&gt;new&lt;/span&gt;&lt;span style="color:#000000"&gt; &lt;/span&gt;&lt;span style="color:#0000FF"&gt;object&lt;/span&gt;&lt;span style="color:#000000"&gt;();

   &lt;/span&gt;&lt;span style="color:#0000FF"&gt;public&lt;/span&gt;&lt;span style="color:#000000"&gt; &lt;/span&gt;&lt;span style="color:#0000FF"&gt;static&lt;/span&gt;&lt;span style="color:#000000"&gt; &lt;/span&gt;&lt;span style="color:#0000FF"&gt;void&lt;/span&gt;&lt;span style="color:#000000"&gt; AddItemCount(&lt;/span&gt;&lt;span style="color:#0000FF"&gt;int&lt;/span&gt;&lt;span style="color:#000000"&gt; itemCount)
   {
      &lt;/span&gt;&lt;span style="color:#0000FF"&gt;lock&lt;/span&gt;&lt;span style="color:#000000"&gt; (Lock)
      {
         &lt;/span&gt;&lt;span style="color:#008000"&gt;//&lt;/span&gt;&lt;span style="color:#008000"&gt; only let one thread write to the setter &lt;/span&gt;&lt;span style="color:#008000"&gt;
&lt;/span&gt;&lt;span style="color:#000000"&gt;         _overallItemCount &lt;/span&gt;&lt;span style="color:#000000"&gt;+=&lt;/span&gt;&lt;span style="color:#000000"&gt; itemCount;
      }
   }

   &lt;/span&gt;&lt;span style="color:#0000FF"&gt;public&lt;/span&gt;&lt;span style="color:#000000"&gt; &lt;/span&gt;&lt;span style="color:#0000FF"&gt;static&lt;/span&gt;&lt;span style="color:#000000"&gt; &lt;/span&gt;&lt;span style="color:#0000FF"&gt;void&lt;/span&gt;&lt;span style="color:#000000"&gt; CountListitemsInAllWebs(&lt;/span&gt;&lt;span style="color:#0000FF"&gt;string&lt;/span&gt;&lt;span style="color:#000000"&gt; siteUrl)
   {
      &lt;/span&gt;&lt;span style="color:#0000FF"&gt;using&lt;/span&gt;&lt;span style="color:#000000"&gt; (var site &lt;/span&gt;&lt;span style="color:#000000"&gt;=&lt;/span&gt;&lt;span style="color:#000000"&gt; &lt;/span&gt;&lt;span style="color:#0000FF"&gt;new&lt;/span&gt;&lt;span style="color:#000000"&gt; SPSite(siteUrl))
      {
         &lt;/span&gt;&lt;span style="color:#008000"&gt;//&lt;/span&gt;&lt;span style="color:#008000"&gt; perform the method/action on any web in the sitecollection &lt;/span&gt;&lt;span style="color:#008000"&gt;
&lt;/span&gt;&lt;span style="color:#000000"&gt;         site.AllWebs.Select(w &lt;/span&gt;&lt;span style="color:#000000"&gt;=&amp;gt;&lt;/span&gt;&lt;span style="color:#000000"&gt; w.ID).EachParallel(webId &lt;/span&gt;&lt;span style="color:#000000"&gt;=&amp;gt;&lt;/span&gt;&lt;span style="color:#000000"&gt;
         {
            CountListitems(site.ID, webId);
         }, Environment.ProcessorCount);
         Console.WriteLine(&lt;/span&gt;&lt;span style="color:#800000"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color:#800000"&gt;Overall Itemcount: &lt;/span&gt;&lt;span style="color:#800000"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color:#000000"&gt; &lt;/span&gt;&lt;span style="color:#000000"&gt;+&lt;/span&gt;&lt;span style="color:#000000"&gt; _overallItemCount);
      }
   }

   &lt;/span&gt;&lt;span style="color:#0000FF"&gt;private&lt;/span&gt;&lt;span style="color:#000000"&gt; &lt;/span&gt;&lt;span style="color:#0000FF"&gt;static&lt;/span&gt;&lt;span style="color:#000000"&gt; &lt;/span&gt;&lt;span style="color:#0000FF"&gt;void&lt;/span&gt;&lt;span style="color:#000000"&gt; CountListitems(Guid siteId, Guid webId)
   {
      &lt;/span&gt;&lt;span style="color:#008000"&gt;//&lt;/span&gt;&lt;span style="color:#008000"&gt; use new instances for each web &lt;/span&gt;&lt;span style="color:#008000"&gt;
&lt;/span&gt;&lt;span style="color:#000000"&gt;      &lt;/span&gt;&lt;span style="color:#0000FF"&gt;using&lt;/span&gt;&lt;span style="color:#000000"&gt; (var site &lt;/span&gt;&lt;span style="color:#000000"&gt;=&lt;/span&gt;&lt;span style="color:#000000"&gt; &lt;/span&gt;&lt;span style="color:#0000FF"&gt;new&lt;/span&gt;&lt;span style="color:#000000"&gt; SPSite(siteId))
      &lt;/span&gt;&lt;span style="color:#0000FF"&gt;using&lt;/span&gt;&lt;span style="color:#000000"&gt; (var web &lt;/span&gt;&lt;span style="color:#000000"&gt;=&lt;/span&gt;&lt;span style="color:#000000"&gt; site.OpenWeb(webId))
      {
         var itemCount &lt;/span&gt;&lt;span style="color:#000000"&gt;=&lt;/span&gt;&lt;span style="color:#000000"&gt; web.Lists.Cast&lt;/span&gt;&lt;span style="color:#000000"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#000000"&gt;SPList&lt;/span&gt;&lt;span style="color:#000000"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color:#000000"&gt;().Sum(list &lt;/span&gt;&lt;span style="color:#000000"&gt;=&amp;gt;&lt;/span&gt;&lt;span style="color:#000000"&gt; list.ItemCount);
         Console.WriteLine(&lt;/span&gt;&lt;span style="color:#800000"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color:#800000"&gt;Web {0} has {1} items in all lists.&lt;/span&gt;&lt;span style="color:#800000"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color:#000000"&gt;, web.Title, itemCount);
         AddItemCount(itemCount);
      }
   }
}&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;That doesn’t look too complicated, does it? The little method &lt;strong&gt;EachParallel&lt;/strong&gt; is all it takes for running the code in multiple threads. &lt;u&gt;You&lt;/u&gt; have to decide if your code can run parallel, and if makes sense!&lt;/p&gt;

&lt;p&gt;Note: &lt;em&gt;Remember that SharePoint will most likely not work, if you access the same objects in multiple threads. So to be safe, create new instances of SharePoint objects in each Thread!&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;The sample above will create as much threads, as your system has CPUs. On my notebook with i7 and HyperThreading in 8 threads. And here comes the point to remember. Think carefully about the pitfalls on running your code parallel. Here are some drawbacks, compared to the sequentiell execution:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Overhead for creating new SharePoint objects (calls to the SQL server) &lt;/li&gt;

  &lt;li&gt;Additional load on the SQL server by querying more data simultaneously (think about a 4 processor server board with x cores and HyperThreading) &lt;/li&gt;

  &lt;li&gt;Possibly more load on the local SharePoint server by writing logfiles &lt;/li&gt;

  &lt;li&gt;Exception handling. With sequential code you can abort. Multiple threads keep running &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Enough for now. Lets look at the Extension method which makes all this possible.&lt;/p&gt;

&lt;div style="padding-bottom:0px;margin:0px;padding-left:0px;padding-right:0px;display:inline;float:none;padding-top:0px" id="scid:57F11A72-B0E5-49c7-9094-E3A15BD5B5E6:8e1a915d-4419-41a5-be48-a658141369a7" class="wlWriterEditableSmartContent"&gt;&lt;pre style="background-color:#FFFFFF;white-space:-moz-pre-wrap;white-space:-pre-wrap;white-space:-o-pre-wrap;white-space:pre-wrap;word-wrap:break-word;overflow:auto"&gt;&lt;span style="color:#0000FF"&gt;public&lt;/span&gt;&lt;span style="color:#000000"&gt; &lt;/span&gt;&lt;span style="color:#0000FF"&gt;static&lt;/span&gt;&lt;span style="color:#000000"&gt; &lt;/span&gt;&lt;span style="color:#0000FF"&gt;class&lt;/span&gt;&lt;span style="color:#000000"&gt; Extensions
{
   &lt;/span&gt;&lt;span style="color:#808080"&gt;///&lt;/span&gt;&lt;span style="color:#008000"&gt; &lt;/span&gt;&lt;span style="color:#808080"&gt;&amp;lt;summary&amp;gt;&lt;/span&gt;&lt;span style="color:#008000"&gt; 
   &lt;/span&gt;&lt;span style="color:#808080"&gt;///&lt;/span&gt;&lt;span style="color:#008000"&gt; Enumerates through each item and start the action in a new thread 
   &lt;/span&gt;&lt;span style="color:#808080"&gt;///&lt;/span&gt;&lt;span style="color:#008000"&gt; &lt;/span&gt;&lt;span style="color:#808080"&gt;&amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;span style="color:#008000"&gt; 
   &lt;/span&gt;&lt;span style="color:#808080"&gt;///&lt;/span&gt;&lt;span style="color:#008000"&gt; &lt;/span&gt;&lt;span style="color:#808080"&gt;&amp;lt;typeparam name=&amp;quot;T&amp;quot;&amp;gt;&amp;lt;/typeparam&amp;gt;&lt;/span&gt;&lt;span style="color:#008000"&gt; 
   &lt;/span&gt;&lt;span style="color:#808080"&gt;///&lt;/span&gt;&lt;span style="color:#008000"&gt; &lt;/span&gt;&lt;span style="color:#808080"&gt;&amp;lt;param name=&amp;quot;enumerable&amp;quot;&amp;gt;&amp;lt;/param&amp;gt;&lt;/span&gt;&lt;span style="color:#008000"&gt; 
   &lt;/span&gt;&lt;span style="color:#808080"&gt;///&lt;/span&gt;&lt;span style="color:#008000"&gt; &lt;/span&gt;&lt;span style="color:#808080"&gt;&amp;lt;param name=&amp;quot;action&amp;quot;&amp;gt;&amp;lt;/param&amp;gt;&lt;/span&gt;&lt;span style="color:#008000"&gt; 
   &lt;/span&gt;&lt;span style="color:#808080"&gt;///&lt;/span&gt;&lt;span style="color:#008000"&gt; &lt;/span&gt;&lt;span style="color:#808080"&gt;&amp;lt;param name=&amp;quot;maxHandles&amp;quot;&amp;gt;&lt;/span&gt;&lt;span style="color:#008000"&gt;e.g. Environment.ProcessorCount&lt;/span&gt;&lt;span style="color:#808080"&gt;&amp;lt;/param&amp;gt;&lt;/span&gt;&lt;span style="color:#008000"&gt; &lt;/span&gt;&lt;span style="color:#808080"&gt;
&lt;/span&gt;&lt;span style="color:#000000"&gt;   &lt;/span&gt;&lt;span style="color:#0000FF"&gt;public&lt;/span&gt;&lt;span style="color:#000000"&gt; &lt;/span&gt;&lt;span style="color:#0000FF"&gt;static&lt;/span&gt;&lt;span style="color:#000000"&gt; &lt;/span&gt;&lt;span style="color:#0000FF"&gt;void&lt;/span&gt;&lt;span style="color:#000000"&gt; EachParallel&lt;/span&gt;&lt;span style="color:#000000"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#000000"&gt;T&lt;/span&gt;&lt;span style="color:#000000"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color:#000000"&gt;(&lt;/span&gt;&lt;span style="color:#0000FF"&gt;this&lt;/span&gt;&lt;span style="color:#000000"&gt; IEnumerable&lt;/span&gt;&lt;span style="color:#000000"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#000000"&gt;T&lt;/span&gt;&lt;span style="color:#000000"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color:#000000"&gt; enumerable, Action&lt;/span&gt;&lt;span style="color:#000000"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#000000"&gt;T&lt;/span&gt;&lt;span style="color:#000000"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color:#000000"&gt; action, &lt;/span&gt;&lt;span style="color:#0000FF"&gt;int&lt;/span&gt;&lt;span style="color:#000000"&gt; maxHandles)
   {
      &lt;/span&gt;&lt;span style="color:#008000"&gt;//&lt;/span&gt;&lt;span style="color:#008000"&gt; enumerate the passed IEnumerable so it can't change during execution &lt;/span&gt;&lt;span style="color:#008000"&gt;
&lt;/span&gt;&lt;span style="color:#000000"&gt;      var itemArray &lt;/span&gt;&lt;span style="color:#000000"&gt;=&lt;/span&gt;&lt;span style="color:#000000"&gt; enumerable.ToArray();
      var count &lt;/span&gt;&lt;span style="color:#000000"&gt;=&lt;/span&gt;&lt;span style="color:#000000"&gt; itemArray.Length;

      &lt;/span&gt;&lt;span style="color:#0000FF"&gt;if&lt;/span&gt;&lt;span style="color:#000000"&gt; (count &lt;/span&gt;&lt;span style="color:#000000"&gt;==&lt;/span&gt;&lt;span style="color:#000000"&gt; &lt;/span&gt;&lt;span style="color:#800080"&gt;0&lt;/span&gt;&lt;span style="color:#000000"&gt;) &lt;/span&gt;&lt;span style="color:#0000FF"&gt;return&lt;/span&gt;&lt;span style="color:#000000"&gt;;
      &lt;/span&gt;&lt;span style="color:#0000FF"&gt;if&lt;/span&gt;&lt;span style="color:#000000"&gt; (count &lt;/span&gt;&lt;span style="color:#000000"&gt;==&lt;/span&gt;&lt;span style="color:#000000"&gt; &lt;/span&gt;&lt;span style="color:#800080"&gt;1&lt;/span&gt;&lt;span style="color:#000000"&gt;)
      {
         &lt;/span&gt;&lt;span style="color:#008000"&gt;//&lt;/span&gt;&lt;span style="color:#008000"&gt; if there's only one element, just execute &lt;/span&gt;&lt;span style="color:#008000"&gt;
&lt;/span&gt;&lt;span style="color:#000000"&gt;         action(itemArray.First());
      }
      &lt;/span&gt;&lt;span style="color:#0000FF"&gt;else&lt;/span&gt;&lt;span style="color:#000000"&gt;
      {
         &lt;/span&gt;&lt;span style="color:#008000"&gt;//&lt;/span&gt;&lt;span style="color:#008000"&gt; maxHandles must not be greatet than the count of actions, or nothing will be done &lt;/span&gt;&lt;span style="color:#008000"&gt;
&lt;/span&gt;&lt;span style="color:#000000"&gt;         &lt;/span&gt;&lt;span style="color:#0000FF"&gt;if&lt;/span&gt;&lt;span style="color:#000000"&gt; (maxHandles &lt;/span&gt;&lt;span style="color:#000000"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color:#000000"&gt; count) maxHandles &lt;/span&gt;&lt;span style="color:#000000"&gt;=&lt;/span&gt;&lt;span style="color:#000000"&gt; count;
         var resetEvents &lt;/span&gt;&lt;span style="color:#000000"&gt;=&lt;/span&gt;&lt;span style="color:#000000"&gt; &lt;/span&gt;&lt;span style="color:#0000FF"&gt;new&lt;/span&gt;&lt;span style="color:#000000"&gt; ManualResetEvent[maxHandles];

         &lt;/span&gt;&lt;span style="color:#0000FF"&gt;for&lt;/span&gt;&lt;span style="color:#000000"&gt; (var offset &lt;/span&gt;&lt;span style="color:#000000"&gt;=&lt;/span&gt;&lt;span style="color:#000000"&gt; &lt;/span&gt;&lt;span style="color:#800080"&gt;0&lt;/span&gt;&lt;span style="color:#000000"&gt;; offset &lt;/span&gt;&lt;span style="color:#000000"&gt;&amp;lt;=&lt;/span&gt;&lt;span style="color:#000000"&gt; count &lt;/span&gt;&lt;span style="color:#000000"&gt;/&lt;/span&gt;&lt;span style="color:#000000"&gt; maxHandles; offset&lt;/span&gt;&lt;span style="color:#000000"&gt;++&lt;/span&gt;&lt;span style="color:#000000"&gt;)
         {
            EachAction(action, maxHandles, itemArray, offset, resetEvents);
            &lt;/span&gt;&lt;span style="color:#008000"&gt;//&lt;/span&gt;&lt;span style="color:#008000"&gt; Wait for all threads to execute &lt;/span&gt;&lt;span style="color:#008000"&gt;
&lt;/span&gt;&lt;span style="color:#000000"&gt;            WaitHandle.WaitAll(resetEvents);
         }
      }
   }

   &lt;/span&gt;&lt;span style="color:#0000FF"&gt;private&lt;/span&gt;&lt;span style="color:#000000"&gt; &lt;/span&gt;&lt;span style="color:#0000FF"&gt;static&lt;/span&gt;&lt;span style="color:#000000"&gt; &lt;/span&gt;&lt;span style="color:#0000FF"&gt;void&lt;/span&gt;&lt;span style="color:#000000"&gt; EachAction&lt;/span&gt;&lt;span style="color:#000000"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#000000"&gt;T&lt;/span&gt;&lt;span style="color:#000000"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color:#000000"&gt;(Action&lt;/span&gt;&lt;span style="color:#000000"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#000000"&gt;T&lt;/span&gt;&lt;span style="color:#000000"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color:#000000"&gt; action, &lt;/span&gt;&lt;span style="color:#0000FF"&gt;int&lt;/span&gt;&lt;span style="color:#000000"&gt; maxHandles, IEnumerable&lt;/span&gt;&lt;span style="color:#000000"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#000000"&gt;T&lt;/span&gt;&lt;span style="color:#000000"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color:#000000"&gt; itemArray, &lt;/span&gt;&lt;span style="color:#0000FF"&gt;int&lt;/span&gt;&lt;span style="color:#000000"&gt; offset, ManualResetEvent[] resetEvents)
   {
      &lt;/span&gt;&lt;span style="color:#0000FF"&gt;int&lt;/span&gt;&lt;span style="color:#000000"&gt; i &lt;/span&gt;&lt;span style="color:#000000"&gt;=&lt;/span&gt;&lt;span style="color:#000000"&gt; &lt;/span&gt;&lt;span style="color:#800080"&gt;0&lt;/span&gt;&lt;span style="color:#000000"&gt;;
      &lt;/span&gt;&lt;span style="color:#0000FF"&gt;foreach&lt;/span&gt;&lt;span style="color:#000000"&gt; (var item &lt;/span&gt;&lt;span style="color:#0000FF"&gt;in&lt;/span&gt;&lt;span style="color:#000000"&gt; itemArray.Skip(offset &lt;/span&gt;&lt;span style="color:#000000"&gt;*&lt;/span&gt;&lt;span style="color:#000000"&gt; maxHandles).Take(maxHandles))
      {
         resetEvents[i] &lt;/span&gt;&lt;span style="color:#000000"&gt;=&lt;/span&gt;&lt;span style="color:#000000"&gt; &lt;/span&gt;&lt;span style="color:#0000FF"&gt;new&lt;/span&gt;&lt;span style="color:#000000"&gt; ManualResetEvent(&lt;/span&gt;&lt;span style="color:#0000FF"&gt;false&lt;/span&gt;&lt;span style="color:#000000"&gt;);

         ThreadPool.QueueUserWorkItem(data &lt;/span&gt;&lt;span style="color:#000000"&gt;=&amp;gt;&lt;/span&gt;&lt;span style="color:#000000"&gt;
         {
            var index &lt;/span&gt;&lt;span style="color:#000000"&gt;=&lt;/span&gt;&lt;span style="color:#000000"&gt; (&lt;/span&gt;&lt;span style="color:#0000FF"&gt;int&lt;/span&gt;&lt;span style="color:#000000"&gt;)((&lt;/span&gt;&lt;span style="color:#0000FF"&gt;object&lt;/span&gt;&lt;span style="color:#000000"&gt;[])data)[&lt;/span&gt;&lt;span style="color:#800080"&gt;0&lt;/span&gt;&lt;span style="color:#000000"&gt;];
            &lt;/span&gt;&lt;span style="color:#0000FF"&gt;try&lt;/span&gt;&lt;span style="color:#000000"&gt;
            {
               &lt;/span&gt;&lt;span style="color:#008000"&gt;//&lt;/span&gt;&lt;span style="color:#008000"&gt; Execute the method and pass in the enumerated item &lt;/span&gt;&lt;span style="color:#008000"&gt;
&lt;/span&gt;&lt;span style="color:#000000"&gt;               action((T)((&lt;/span&gt;&lt;span style="color:#0000FF"&gt;object&lt;/span&gt;&lt;span style="color:#000000"&gt;[])data)[&lt;/span&gt;&lt;span style="color:#800080"&gt;1&lt;/span&gt;&lt;span style="color:#000000"&gt;]);
            }
            &lt;/span&gt;&lt;span style="color:#0000FF"&gt;catch&lt;/span&gt;&lt;span style="color:#000000"&gt; (Exception ex)
            {
               &lt;/span&gt;&lt;span style="color:#008000"&gt;//&lt;/span&gt;&lt;span style="color:#008000"&gt; Exception handling &lt;/span&gt;&lt;span style="color:#008000"&gt;
&lt;/span&gt;&lt;span style="color:#000000"&gt;               Console.WriteLine(ex.ToString());
            }

            &lt;/span&gt;&lt;span style="color:#008000"&gt;//&lt;/span&gt;&lt;span style="color:#008000"&gt; Tell the calling thread that we're done &lt;/span&gt;&lt;span style="color:#008000"&gt;
&lt;/span&gt;&lt;span style="color:#000000"&gt;            resetEvents[index].Set();
         }, &lt;/span&gt;&lt;span style="color:#0000FF"&gt;new&lt;/span&gt;&lt;span style="color:#000000"&gt; &lt;/span&gt;&lt;span style="color:#0000FF"&gt;object&lt;/span&gt;&lt;span style="color:#000000"&gt;[] { i, item });
         i&lt;/span&gt;&lt;span style="color:#000000"&gt;++&lt;/span&gt;&lt;span style="color:#000000"&gt;;
      }
   }
}&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;All items in the IEnumerable are iterated. If there is free slot, the action will be executed in a new thread. There is no guarantee, that the code is executed in the same order, as the items in your IEnumerable. Here is an examples of IDs in an array, and the execution order:&lt;/p&gt;

&lt;table border="1" cellspacing="0" cellpadding="2" width="214"&gt;&lt;tbody&gt;
    &lt;tr&gt;
      &lt;td valign="top" width="100"&gt;Order in List&lt;/td&gt;

      &lt;td valign="top" width="112"&gt;Execution order&lt;/td&gt;
    &lt;/tr&gt;

    &lt;tr&gt;
      &lt;td valign="top" width="100"&gt;0&lt;/td&gt;

      &lt;td valign="top" width="112"&gt;3&lt;/td&gt;
    &lt;/tr&gt;

    &lt;tr&gt;
      &lt;td valign="top" width="100"&gt;1&lt;/td&gt;

      &lt;td valign="top" width="112"&gt;6&lt;/td&gt;
    &lt;/tr&gt;

    &lt;tr&gt;
      &lt;td valign="top" width="100"&gt;2&lt;/td&gt;

      &lt;td valign="top" width="112"&gt;7&lt;/td&gt;
    &lt;/tr&gt;

    &lt;tr&gt;
      &lt;td valign="top" width="100"&gt;3&lt;/td&gt;

      &lt;td valign="top" width="112"&gt;1&lt;/td&gt;
    &lt;/tr&gt;

    &lt;tr&gt;
      &lt;td valign="top" width="100"&gt;4&lt;/td&gt;

      &lt;td valign="top" width="112"&gt;4&lt;/td&gt;
    &lt;/tr&gt;

    &lt;tr&gt;
      &lt;td valign="top" width="100"&gt;5&lt;/td&gt;

      &lt;td valign="top" width="112"&gt;0&lt;/td&gt;
    &lt;/tr&gt;

    &lt;tr&gt;
      &lt;td valign="top" width="100"&gt;6&lt;/td&gt;

      &lt;td valign="top" width="112"&gt;2&lt;/td&gt;
    &lt;/tr&gt;

    &lt;tr&gt;
      &lt;td valign="top" width="100"&gt;7&lt;/td&gt;

      &lt;td valign="top" width="112"&gt;5&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;&lt;/table&gt;

&lt;p&gt;Summary: Depending on your code, and its requirements, multiple threads can be a good way to improve the speed of you code. It even can be a life-saver (thx Christopher!) for very long running operations. Take your time to think about it, before you implement the “little” change to your code to run in multiple threads!&lt;/p&gt;

&lt;p&gt;One last word. I mentioned .NET 4 at the beginning. Here is a sample.&lt;/p&gt;

&lt;div style="padding-bottom:0px;margin:0px;padding-left:0px;padding-right:0px;display:inline;float:none;padding-top:0px" id="scid:57F11A72-B0E5-49c7-9094-E3A15BD5B5E6:33e36369-7b0e-446b-af92-9ab5e543962e" class="wlWriterEditableSmartContent"&gt;&lt;pre style="background-color:#FFFFFF;overflow:auto"&gt;&lt;span style="color:#000000"&gt;var ids &lt;/span&gt;&lt;span style="color:#000000"&gt;=&lt;/span&gt;&lt;span style="color:#000000"&gt; &lt;/span&gt;&lt;span style="color:#0000FF"&gt;new&lt;/span&gt;&lt;span style="color:#000000"&gt; List&lt;/span&gt;&lt;span style="color:#000000"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#0000FF"&gt;int&lt;/span&gt;&lt;span style="color:#000000"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color:#000000"&gt; { &lt;/span&gt;&lt;span style="color:#800080"&gt;0&lt;/span&gt;&lt;span style="color:#000000"&gt;, &lt;/span&gt;&lt;span style="color:#800080"&gt;1&lt;/span&gt;&lt;span style="color:#000000"&gt;, &lt;/span&gt;&lt;span style="color:#800080"&gt;2&lt;/span&gt;&lt;span style="color:#000000"&gt;, &lt;/span&gt;&lt;span style="color:#800080"&gt;3&lt;/span&gt;&lt;span style="color:#000000"&gt;, &lt;/span&gt;&lt;span style="color:#800080"&gt;4&lt;/span&gt;&lt;span style="color:#000000"&gt;, &lt;/span&gt;&lt;span style="color:#800080"&gt;5&lt;/span&gt;&lt;span style="color:#000000"&gt; }; 
ids.AsParallel().ForAll(id &lt;/span&gt;&lt;span style="color:#000000"&gt;=&amp;gt;&lt;/span&gt;&lt;span style="color:#000000"&gt; { Console.WriteLine(&lt;/span&gt;&lt;span style="color:#800000"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color:#800000"&gt;Id: &lt;/span&gt;&lt;span style="color:#800000"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color:#000000"&gt; &lt;/span&gt;&lt;span style="color:#000000"&gt;+&lt;/span&gt;&lt;span style="color:#000000"&gt; id); });&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Nice, ain’t it?&lt;/p&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/ReneHezser/~4/VwWiDvsdfmQ" height="1" width="1"/&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">René Hézser</dc:creator><pubDate>Sat, 28 Apr 2012 11:19:47 GMT</pubDate><category domain="http://www.hezser.de/blog/archive/tags/Development/default.aspx">Development</category><category domain="http://www.hezser.de/blog/archive/tags/SharePoint/default.aspx">SharePoint</category><feedburner:origLink>http://www.hezser.de/blog/archive/2012/04/28/execute-code-in-multiple-threads-even-with-sharepoint.aspx</feedburner:origLink></item><item><title>Major Update to the Fileserveraccess Web Part</title><link>http://feedproxy.google.com/~r/ReneHezser/~3/1tiSuzmFT8I/major-update-to-the-fileserveraccess-web-part.aspx</link><guid isPermaLink="False">/blog/archive/2012/01/12/major-update-to-the-fileserveraccess-web-part.aspx</guid><description>&lt;div class="ExternalClass023720F28F814018BC0551B5198B9F2C"&gt;&lt;p&gt;In 2008 I’ve released a Web Part, which enables your users to access files on your fileservers through SharePoint. &lt;a href="http://www.hezser.de/blog/Lists/Beitraege/Post.aspx?ID=86" target="_blank"&gt;Original post&lt;/a&gt;. This Web Part has been downloaded many times. With this new version, I’ve tried to deal with the most asked questions (like Kerberos), which will make the Web Part easier to use. Naturally new features have been implemented, to get you to upgrade to the new version.&lt;/p&gt;  &lt;p&gt;With this release, the Web Part requires SharePoint Foundation / Server 2010. For the users who are still using WSS V3, please stick to the old version, or upgrade your farm &lt;img style="border-bottom-style:none;border-left-style:none;border-top-style:none;border-right-style:none" class="wlEmoticon wlEmoticon-smile" alt="Smile" src="http://www.hezser.de/blog/Media/Windows-Live-Writer/a28bbaf2a161_5FA0/wlEmoticon-smile_2.png"&gt;&lt;/p&gt;  &lt;p&gt;First some screenshots, so you know what I am talking about.&lt;/p&gt;  &lt;p&gt;&lt;img style="background-image:none;border-right-width:0px;padding-left:0px;padding-right:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;padding-top:0px" title="image" border="0" alt="image" src="http://www.hezser.de/blog/Media/Windows-Live-Writer/a28bbaf2a161_5FA0/image_15.png" width="618" height="272"&gt;&lt;/p&gt;  &lt;table border="0" cellspacing="0" cellpadding="2" width="500"&gt;&lt;tbody&gt;     &lt;tr&gt;       &lt;td valign="top" width="250"&gt;&lt;a href="http://www.hezser.de/blog/Media/Windows-Live-Writer/a28bbaf2a161_5FA0/image_13.png"&gt;&lt;img style="background-image:none;border-right-width:0px;padding-left:0px;padding-right:0px;display:inline;float:left;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;padding-top:0px" title="image" border="0" alt="image" align="left" src="http://www.hezser.de/blog/Media/Windows-Live-Writer/a28bbaf2a161_5FA0/image_thumb_1.png" width="244" height="165"&gt;&lt;/a&gt;&lt;/td&gt;        &lt;td valign="top" width="250"&gt;&lt;a href="http://www.hezser.de/blog/Media/Windows-Live-Writer/a28bbaf2a161_5FA0/image_18.png"&gt;&lt;img style="background-image:none;border-right-width:0px;padding-left:0px;padding-right:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;padding-top:0px" title="image" border="0" alt="image" src="http://www.hezser.de/blog/Media/Windows-Live-Writer/a28bbaf2a161_5FA0/image_thumb_3.png" width="244" height="93"&gt;&lt;/a&gt;&lt;/td&gt;     &lt;/tr&gt;   &lt;/tbody&gt;&lt;/table&gt;  &lt;h2&gt;Features&lt;/h2&gt;  &lt;ul&gt;   &lt;li&gt;Download files from your fileservers via SharePoint &lt;/li&gt;    &lt;li&gt;Download a folder with all containing files as zip-file &lt;/li&gt;    &lt;li&gt;Upload files to a fileserver &lt;/li&gt;    &lt;li&gt;Delete files from a fileserver &lt;/li&gt;    &lt;li&gt;View the file properties &lt;/li&gt;    &lt;li&gt;By default, the fileserver path has to be UNC. Local paths are not allowed, so a user cannot enter C:\ to access e.g. the web.config or other files on the local server &lt;/li&gt;    &lt;li&gt;Multilanguage &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;Of coarse the access to the files is security trimmed. Meaning that if your users would not be able to access files with their logon from their client, they won’t be able from the Web Part!&lt;/p&gt;  &lt;h2&gt;Requirements&lt;/h2&gt;  &lt;p&gt;For authorization against the fileserver, the credentials of the currently logged on user is used. For SharePoint (and any other application as well), it is necessary to configure the WebApplication which is hosting the Web Part to use Kerberos instead of NTLM. Otherwise a server cannot pass the user credentials forward to a second server. This is called the “Double-Hop problem”. To get a glimpse about the topic, take a look at an article I wrote some time ago. &lt;a href="http://www.hezser.de/blog/Lists/Beitraege/Post.aspx?ID=88" target="_blank"&gt;Configuring Kerberos for SharePoint&lt;/a&gt;. That post has been written for SharePoint V3! But there&lt;img style="background-image:none;border-right-width:0px;padding-left:0px;padding-right:0px;display:inline;float:right;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;padding-top:0px" title="image" border="0" alt="image" align="right" src="http://www.hezser.de/blog/Media/Windows-Live-Writer/a28bbaf2a161_5FA0/image_11.png" width="213" height="121"&gt; are plenty of Kerberos Guides out there for SP 2010. And a whitepaper from Microsoft: Configuring Kerberos Authentication for SharePoint 2010 Products &lt;a href="http://technet.microsoft.com/en-us/library/ff829837.aspx"&gt;http://technet.microsoft.com/en-us/library/ff829837.aspx&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;If you do not configure Kerberos for the WebApplication, the Web Part will detect that, and show a notification in the properties section.&lt;/p&gt;  &lt;p&gt;A small sidenote: &lt;em&gt;If you are going to use local paths (meaning a folder on your SharePoint server), you can continue using NTLM.&lt;/em&gt; &lt;/p&gt;  &lt;p&gt;Another good starting point for Kerberos-Troubleshooting can be found here: &lt;a title="http://blogs.msdn.com/b/friis/archive/2009/12/31/things-to-check-when-kerberos-authentication-fails-using-iis-ie.aspx" href="http://blogs.msdn.com/b/friis/archive/2009/12/31/things-to-check-when-kerberos-authentication-fails-using-iis-ie.aspx"&gt;http://blogs.msdn.com/b/friis/archive/2009/12/31/things-to-check-when-kerberos-authentication-fails-using-iis-ie.aspx&lt;/a&gt;&lt;/p&gt;  &lt;h2&gt;Configuration&lt;/h2&gt;  &lt;p&gt;&lt;a href="http://www.hezser.de/blog/Media/Windows-Live-Writer/a28bbaf2a161_5FA0/image_10.png"&gt;&lt;img style="background-image:none;border-right-width:0px;padding-left:0px;padding-right:0px;display:inline;float:left;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;padding-top:0px" title="image" border="0" alt="image" align="left" src="http://www.hezser.de/blog/Media/Windows-Live-Writer/a28bbaf2a161_5FA0/image_thumb_4.png" width="113" height="244"&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;To use the WebPart, you’ll need to at least configure a path. Files – and subfolders – from that path will be shown.&lt;/p&gt;  &lt;p&gt;Additionally, there are some properties, which modify features of the Web Part.&lt;/p&gt;  &lt;p&gt;The &lt;strong&gt;Paging size&lt;/strong&gt; defines, how many files are displayed on one page. With the next three checkboxes, you can allow files to be downloaded as zip, allow files to be uploaded and to be deleted.&lt;/p&gt;  &lt;p&gt;I recommend to leave the caching activated. Deactivate only, if you have specific reasons, because there will be more todo for your SharePoint server and fileserver.&lt;/p&gt;  &lt;h3&gt;Using a local path as source&lt;/h3&gt;  &lt;p&gt;In case you want to use a local path as source for the Web Part, you have to allow the path to be used. To do so, follow the steps below.&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;locate the feature.xml file (&amp;quot;C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\FEATURES\FileserverAccess\Feature.xml&amp;quot;) &lt;/li&gt;    &lt;li&gt;Edit the file in your favorite editor &lt;/li&gt;    &lt;li&gt;Look for the property with the key “AllowLocalPaths” and modify the value to correspond to the driveletter you wish to use      &lt;br&gt;&lt;img style="background-image:none;border-right-width:0px;padding-left:0px;padding-right:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;padding-top:0px" title="image" border="0" alt="image" src="http://www.hezser.de/blog/Media/Windows-Live-Writer/a28bbaf2a161_5FA0/image_16.png" width="588" height="186"&gt;       &lt;br&gt;Replace “Driveletter” with e.g. “C”. You can specify more than one drive letters. In that case use a “;” as divider &lt;/li&gt;    &lt;li&gt;Save the feature.xml &lt;/li&gt;    &lt;li&gt;Restart your IIS (iisreset) &lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;Remember that you’ll need to modify the file on all of your FrontEnd SharePoint Servers! After an upgrade of the Web Part, the file has to be modified again. If you do not allow local drives, the Web Part will show an error.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.hezser.de/blog/Media/Windows-Live-Writer/a28bbaf2a161_5FA0/image_6.png"&gt;&lt;img style="background-image:none;border-right-width:0px;padding-left:0px;padding-right:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;padding-top:0px" title="image" border="0" alt="image" src="http://www.hezser.de/blog/Media/Windows-Live-Writer/a28bbaf2a161_5FA0/image_thumb_2.png" width="211" height="122"&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;This version is compatible to the old version. So you can simply upgrade the solution and benefit of the new features!&lt;/p&gt;  &lt;p&gt;Download the new version for SharePoint 2010 (Foundation and Server): &lt;a href="http://www.hezser.de/Downloads/2010/RH.FileserverAccess.wsp"&gt;RH.FileserverAccess.wsp&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Download the old version for WSS V3 / MOSS 2007: &lt;a href="http://www.hezser.de/Downloads/RH.FileserverAccess.wsp"&gt;RH.FileserverAccess.wsp&lt;/a&gt;&lt;/p&gt;  &lt;h3&gt;Update March 2012&lt;/h3&gt;  &lt;ul&gt;   &lt;li&gt;I did not get the Web Part working in my claims based authentication test-environment. Additionally, the Web Part properties will show the current user and authentication method. If you see Negotiate, your environment is set up correctly (for classic authentication).&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&lt;img style="background-image:none;border-right-width:0px;padding-left:0px;padding-right:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;padding-top:0px" title="image" border="0" alt="image" src="http://www.hezser.de/blog/Media/Windows-Live-Writer/a28bbaf2a161_5FA0/image_22.png" width="277" height="209"&gt;&lt;img style="background-image:none;border-right-width:0px;padding-left:0px;padding-right:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;padding-top:0px" title="image" border="0" alt="image" src="http://www.hezser.de/blog/Media/Windows-Live-Writer/a28bbaf2a161_5FA0/image_25.png" width="277" height="209"&gt;&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Another small update, which prevented the upload from working in Chrome&lt;/li&gt; &lt;/ul&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/ReneHezser/~4/1tiSuzmFT8I" height="1" width="1"/&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">René Hézser</dc:creator><pubDate>Thu, 12 Jan 2012 20:33:23 GMT</pubDate><category domain="http://www.hezser.de/blog/archive/tags/Development/default.aspx">Development</category><category domain="http://www.hezser.de/blog/archive/tags/Fileserver Access/default.aspx">Fileserver Access</category><category domain="http://www.hezser.de/blog/archive/tags/SharePoint/default.aspx">SharePoint</category><category domain="http://www.hezser.de/blog/archive/tags/Webparts/default.aspx">Webparts</category><feedburner:origLink>http://www.hezser.de/blog/archive/2012/01/12/major-update-to-the-fileserveraccess-web-part.aspx</feedburner:origLink></item><item><title>Das neue Jahre bringt neue Aufgaben</title><link>http://feedproxy.google.com/~r/ReneHezser/~3/9cNOK19PJHs/das-neue-jahre-bringt-neue-aufgaben.aspx</link><guid isPermaLink="False">/blog/archive/2012/01/01/das-neue-jahre-bringt-neue-aufgaben.aspx</guid><description>&lt;div class="ExternalClass972A3C7F6D0A4F1BA47907E9776813BE"&gt;&lt;p&gt;Nach fast 8 Jahren bei der Firma Net at Work, startet für mich ein neues Kapitel. Auch auf diesem Wege möchte ich mich noch einmal bei allen Kollegen und Kunden für die Zusammenarbeit bedanken.&lt;/p&gt;  &lt;p&gt;Ab heute hat es mich beruflich nach Berlin verschlagen. Dort habe ich bei der ITaCS angedockt. Ich freue mich auf neue Projekte und Herausforderungen.&lt;/p&gt;  &lt;p&gt;Ach ja. Ich wünsche allen Lesern ein Frohes Neues Jahr!&lt;/p&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/ReneHezser/~4/9cNOK19PJHs" height="1" width="1"/&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">René Hézser</dc:creator><pubDate>Sun, 01 Jan 2012 22:07:41 GMT</pubDate><category domain="http://www.hezser.de/blog/archive/tags/Sonstiges/default.aspx">Sonstiges</category><feedburner:origLink>http://www.hezser.de/blog/archive/2012/01/01/das-neue-jahre-bringt-neue-aufgaben.aspx</feedburner:origLink></item><item><title>Update to the “My Alerts” Webpart</title><link>http://feedproxy.google.com/~r/ReneHezser/~3/kGBGl0Jh2ok/update-to-the-“my-alerts”-webpart.aspx</link><guid isPermaLink="False">/blog/archive/2011/12/20/update-to-the-“my-alerts”-webpart.aspx</guid><description>&lt;div class="ExternalClassFD3552C1518B4825951B488EC20BD8EB"&gt;&lt;p&gt;I’ve made a small update to the &lt;a href="http://www.hezser.de/blog/archive/2007/11/04/display-all-my-alerts.aspx"&gt;My Alerts Webpart&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;The update improves SharePoint 2010 support.&lt;/p&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/ReneHezser/~4/kGBGl0Jh2ok" height="1" width="1"/&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">René Hézser</dc:creator><pubDate>Tue, 20 Dec 2011 19:17:20 GMT</pubDate><category domain="http://www.hezser.de/blog/archive/tags/Development/default.aspx">Development</category><category domain="http://www.hezser.de/blog/archive/tags/MyAlerts/default.aspx">MyAlerts</category><category domain="http://www.hezser.de/blog/archive/tags/SharePoint/default.aspx">SharePoint</category><category domain="http://www.hezser.de/blog/archive/tags/Webparts/default.aspx">Webparts</category><feedburner:origLink>http://www.hezser.de/blog/archive/2011/12/20/update-to-the-“my-alerts”-webpart.aspx</feedburner:origLink></item><item><title>Update: WarmupScript</title><link>http://feedproxy.google.com/~r/ReneHezser/~3/e4JrJsznJAU/update-warmupscript.aspx</link><guid isPermaLink="False">/blog/archive/2011/11/28/update-warmupscript.aspx</guid><description>&lt;div class="ExternalClass6B20E13512CF408F88E4B96958DB72B5"&gt;&lt;p&gt;A l&lt;a href="http://www.hezser.de/blog/archive/2008/03/02/warmupsharepoint.aspx" target="_blank"&gt;ong time ago&lt;/a&gt;, I posted a program which will hit all your sites. With parameters you can specify to hit all sites within a sitecollection.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.hezser.de/blog/Media/Windows-Live-Writer/Update-WarmupScript_D4E5/image_2.png"&gt;&lt;img style="background-image:none;border-right-width:0px;padding-left:0px;padding-right:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;padding-top:0px" title="image" border="0" alt="image" src="http://www.hezser.de/blog/Media/Windows-Live-Writer/Update-WarmupScript_D4E5/image_thumb.png" width="504" height="256"&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;This program has been updated. You can not omit a start Url, and specify “Farm” as parameter. This way, all sites in all sitecollections in all webapplications in all… &lt;img style="border-bottom-style:none;border-left-style:none;border-top-style:none;border-right-style:none" class="wlEmoticon wlEmoticon-winkingsmile" alt="Winking smile" src="http://www.hezser.de/blog/Media/Windows-Live-Writer/Update-WarmupScript_D4E5/wlEmoticon-winkingsmile_2.png"&gt; will be warmed up.&lt;/p&gt;  &lt;p&gt;The warmup will use a HttpRequest to query all homepages. It will not hit every page in the pages libraries, but hitting each web is sufficient for most scenarios.&lt;/p&gt;  &lt;p&gt;One thing to mention. If you want to warmup your Central Administration, you’ll have to call the program with the Url, as the CA will not be included in the webapplication enumeration of a SharePoint farm.&lt;/p&gt;  &lt;p&gt;Usage:&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;WarmupSharePoint &lt;/strong&gt;&lt;a href="http://your.server.url"&gt;&lt;strong&gt;http://your.server.url&lt;/strong&gt;&lt;/a&gt;&lt;strong&gt; [AllSites]&lt;/strong&gt; – will hit one site only, unless the AllSites parameter is specified. Then all sites will be dealed with.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;WarmupSharePoint Farm&lt;/strong&gt; – iterates through all sitecollections and hit all sites within&lt;/p&gt;  &lt;p&gt;Download the &lt;a href="http://www.hezser.de/Downloads/WarmupSharePoint.zip"&gt;program&lt;/a&gt;    &lt;br&gt;Download the &lt;a href="http://www.hezser.de/Downloads/WarmupSharePointSourcecode.zip"&gt;sourcecode&lt;/a&gt;&lt;/p&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/ReneHezser/~4/e4JrJsznJAU" height="1" width="1"/&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">René Hézser</dc:creator><pubDate>Mon, 28 Nov 2011 20:43:19 GMT</pubDate><category domain="http://www.hezser.de/blog/archive/tags/Development/default.aspx">Development</category><category domain="http://www.hezser.de/blog/archive/tags/SharePoint/default.aspx">SharePoint</category><feedburner:origLink>http://www.hezser.de/blog/archive/2011/11/28/update-warmupscript.aspx</feedburner:origLink></item><item><title>What to know about the feature folder</title><link>http://feedproxy.google.com/~r/ReneHezser/~3/JxITGJmC8Nw/what-to-know-about-the-feature-folder.aspx</link><guid isPermaLink="False">/blog/archive/2011/11/21/what-to-know-about-the-feature-folder.aspx</guid><description>&lt;div class="ExternalClassB332A3CDAB4E4774B4DCB96496EF3879"&gt;&lt;p&gt;One of the first things I used to tell guys new to SharePoint development is: Never ever name the folder of your feature “Feature1”. If you create a solution with WSPBuilder, or did some time ago with VS 2008, you have to rename the folders immediately!&lt;/p&gt;  &lt;p&gt;&lt;img style="background-image:none;border-right-width:0px;padding-left:0px;padding-right:0px;display:inline;float:left;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;padding-top:0px" title="image" border="0" alt="image" align="left" src="http://www.hezser.de/blog/Media/Windows-Live-Writer/What-to-know-about-the-feature-folder_126D6/image_20.png" width="220" height="277"&gt;&lt;/p&gt;  &lt;p&gt;This is how a typical SharePoint project looks like, if you create features. I guess most of us have used the mighty WSPBuilder (&lt;a href="http://wspbuilder.codeplex.com" target="_blank"&gt;http://wspbuilder.codeplex.com&lt;/a&gt;) for developing with SharePoint.&lt;img style="background-image:none;border-right-width:0px;padding-left:0px;padding-right:0px;display:inline;float:right;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;padding-top:0px" title="image" border="0" alt="image" align="right" src="http://www.hezser.de/blog/Media/Windows-Live-Writer/What-to-know-about-the-feature-folder_126D6/image_18.png" width="291" height="292"&gt;&lt;/p&gt;  &lt;p&gt;After building the VS solution and creating a WSP package with WSPBuilder, the wsp contains two folders. They reflect the names, we defined in VS. &lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt;Now lets take a look at the same features in a Visual Studio 2010 SharePoint Solution.&lt;/p&gt;  &lt;p&gt;&lt;img style="background-image:none;border-right-width:0px;padding-left:0px;padding-right:0px;display:inline;float:left;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;padding-top:0px" title="image" border="0" alt="image" align="left" src="http://www.hezser.de/blog/Media/Windows-Live-Writer/What-to-know-about-the-feature-folder_126D6/image_19.png" width="194" height="206"&gt;&lt;/p&gt;  &lt;p&gt;It almost looks the same as a WSPBuilder solution in VS 2008. &lt;/p&gt;  &lt;p&gt;The features have been created by right-clicking on the Features folder in the Solution Explorer. This is important.&lt;/p&gt;  &lt;p&gt;In many places VS uses tokens to replace strings with certain solution specific values like the assembly name. You can take a look at the tokens here: &lt;a href="http://msdn.microsoft.com/en-us/library/ee231545.aspx" target="_blank"&gt;Replaceable Parameters&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;If we look at the wsp again, we notice the difference. Visual Studio 2010 has&lt;img style="background-image:none;border-right-width:0px;padding-left:0px;padding-right:0px;display:inline;float:right;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;padding-top:0px" title="image" border="0" alt="image" align="right" src="http://www.hezser.de/blog/Media/Windows-Live-Writer/What-to-know-about-the-feature-folder_126D6/image_17.png" width="207" height="112"&gt; added the solution name as prefix to the feature folders. Great. Thank you Microsoft. Now we can name our feature folders e.g. after the scope. (Site, Web, Webapplication of Farm), and do not have to worry about duplicate names.&lt;/p&gt;  &lt;p&gt;The magic of this can be seen, if we take a look at the properties of the feature folders.&lt;/p&gt;  &lt;p&gt;&lt;img style="background-image:none;border-right-width:0px;padding-left:0px;padding-right:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;padding-top:0px" title="image" border="0" alt="image" src="http://www.hezser.de/blog/Media/Windows-Live-Writer/What-to-know-about-the-feature-folder_126D6/image_21.png" width="604" height="166"&gt;&lt;/p&gt;  &lt;p&gt;Conclusion: VS 2010 is a great improvement to us SharePoint developers. We don’t have to know all the places where it helps, but it can’t hurt, either. I hope this article brings a little light to the magic &lt;img style="border-bottom-style:none;border-left-style:none;border-top-style:none;border-right-style:none" class="wlEmoticon wlEmoticon-winkingsmile" alt="Winking smile" src="http://www.hezser.de/blog/Media/Windows-Live-Writer/What-to-know-about-the-feature-folder_126D6/wlEmoticon-winkingsmile_2.png"&gt;&lt;/p&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/ReneHezser/~4/JxITGJmC8Nw" height="1" width="1"/&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">René Hézser</dc:creator><pubDate>Mon, 21 Nov 2011 22:06:35 GMT</pubDate><category domain="http://www.hezser.de/blog/archive/tags/Development/default.aspx">Development</category><category domain="http://www.hezser.de/blog/archive/tags/SharePoint/default.aspx">SharePoint</category><category domain="http://www.hezser.de/blog/archive/tags/Visual Studio/default.aspx">Visual Studio</category><feedburner:origLink>http://www.hezser.de/blog/archive/2011/11/21/what-to-know-about-the-feature-folder.aspx</feedburner:origLink></item><item><title>Use Powershell ISE for SharePoint 2010</title><link>http://feedproxy.google.com/~r/ReneHezser/~3/aMmigJL0LXo/use-powershell-ise-for-sharepoint-2010.aspx</link><guid isPermaLink="False">/blog/archive/2011/11/15/use-powershell-ise-for-sharepoint-2010.aspx</guid><description>&lt;div class="ExternalClass845E42FFF3B9462399CF19EC33E6EA4F"&gt;&lt;p&gt;To be able to use the ISE for SharePoint, you can configure it to load the SharePoint cmdlets automatically.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.shillier.com" target="_blank"&gt;Scot Hillier&lt;/a&gt; wrote a great article about it. Read “&lt;a href="http://www.shillier.com/archive/2010/01/18/setting-up-powershell-ise-for-sharepoint-2010.aspx" target="_blank"&gt;Setting up PowerShell ISE for SharePoint 2010&lt;/a&gt;”.&lt;/p&gt;  &lt;p&gt;If you only want to use the SharePoint cmdlets once, you can register them with this two lines:&lt;/p&gt;    &lt;div style="padding-bottom:0px;margin:0px;padding-left:0px;padding-right:0px;display:inline;float:none;padding-top:0px" id="scid:57F11A72-B0E5-49c7-9094-E3A15BD5B5E6:cdfad2ee-b576-4df6-97b6-87aa8786390b" class="wlWriterEditableSmartContent"&gt;&lt;pre style="background-color:#FFFFFF;overflow:auto"&gt;&lt;span style="color:#0000FF"&gt;If&lt;/span&gt;&lt;span style="color:#000000"&gt; ((Get&lt;/span&gt;&lt;span style="color:#000000"&gt;-&lt;/span&gt;&lt;span style="color:#000000"&gt;PSSnapIn &lt;/span&gt;&lt;span style="color:#000000"&gt;-&lt;/span&gt;&lt;span style="color:#000000"&gt;Name Microsoft.SharePoint.PowerShell &lt;/span&gt;&lt;span style="color:#000000"&gt;-&lt;/span&gt;&lt;span style="color:#000000"&gt;ErrorAction SilentlyContinue) &lt;/span&gt;&lt;span style="color:#008080"&gt;-eq&lt;/span&gt;&lt;span style="color:#000000"&gt; &lt;/span&gt;&lt;span style="color:#800080"&gt;$null&lt;/span&gt;&lt;span style="color:#000000"&gt; )
{ Add&lt;/span&gt;&lt;span style="color:#000000"&gt;-&lt;/span&gt;&lt;span style="color:#000000"&gt;PSSnapIn &lt;/span&gt;&lt;span style="color:#000000"&gt;-&lt;/span&gt;&lt;span style="color:#000000"&gt;Name Microsoft.SharePoint.PowerShell }&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/ReneHezser/~4/aMmigJL0LXo" height="1" width="1"/&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">René Hézser</dc:creator><pubDate>Tue, 15 Nov 2011 14:45:22 GMT</pubDate><category domain="http://www.hezser.de/blog/archive/tags/Powershell/default.aspx">Powershell</category><category domain="http://www.hezser.de/blog/archive/tags/SharePoint/default.aspx">SharePoint</category><feedburner:origLink>http://www.hezser.de/blog/archive/2011/11/15/use-powershell-ise-for-sharepoint-2010.aspx</feedburner:origLink></item><item><title>SharePoint 2010 and HTML5</title><link>http://feedproxy.google.com/~r/ReneHezser/~3/aMD0eAhtUTM/sharepoint-2010-and-html5.aspx</link><guid isPermaLink="False">/blog/archive/2011/11/02/sharepoint-2010-and-html5.aspx</guid><description>&lt;div class="ExternalClassC3B8D38EB5ED4C7FB867924445CC257E"&gt;&lt;blockquote&gt;   &lt;p&gt;“v5.master” is a simple HTML5 master page designed for SharePoint 2010. It makes good use of the amazing new features of both HTML5 and CSS3, including &lt;a href="http://kyleschaeffer.com/best-practices/responsive-layouts-using-css-media-queries/"&gt;CSS3 media queries&lt;/a&gt;. The master page is extremely simplistic in nature, and is truly meant to serve as a framework for building your own SharePoint 2010 customizations.&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Here comes some good news for SharePoint and HTML 5. If you want to build your masterpage for HTML 5, you can: &lt;a title="http://kyleschaeffer.com/sharepoint/v5-responsive-html5-master-page/" href="http://kyleschaeffer.com/sharepoint/v5-responsive-html5-master-page/"&gt;http://kyleschaeffer.com/sharepoint/v5-responsive-html5-master-page/&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Thank you, Kyle!&lt;/p&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/ReneHezser/~4/aMD0eAhtUTM" height="1" width="1"/&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">René Hézser</dc:creator><pubDate>Wed, 02 Nov 2011 08:58:49 GMT</pubDate><category domain="http://www.hezser.de/blog/archive/tags/SharePoint/default.aspx">SharePoint</category><feedburner:origLink>http://www.hezser.de/blog/archive/2011/11/02/sharepoint-2010-and-html5.aspx</feedburner:origLink></item></channel></rss>

