tag:blogger.com,1999:blog-40415444172273627202024-03-13T09:00:37.121-07:00Blee Blah of .NetMy opinion on Microsoft .Net and other relevant programming technologies.Anonymoushttp://www.blogger.com/profile/09015555753126554122noreply@blogger.comBlogger38125tag:blogger.com,1999:blog-4041544417227362720.post-51631083736329321282014-01-29T12:06:00.002-08:002014-01-29T12:06:37.050-08:00Blog moved to DevLaundry.comI have decided to move my blog to a personally developed site where I can create better content. The site is build on Node.js and hosted on the Azure Cloud platform.<br />
<br />
Site:<a href="http://www.devlaundry.com/" target="_blank"> http://www.devlaundry.com</a><br />
<br />
Please visit the new site and any feedback will be appreciated. I will move some of my blog entries over to the new site. Hope to see you on the new site!!!Anonymoushttp://www.blogger.com/profile/09015555753126554122noreply@blogger.comtag:blogger.com,1999:blog-4041544417227362720.post-60293156991082555352012-10-08T23:26:00.001-07:002012-10-08T23:26:20.436-07:00SharePoint 2010–Using Merge-SPLogFile to Find Correlation ID<p>When you are hit with a problem in SharePoint 2010 you get notified to use a correlation id to check for further details in the trace logs (ULS logs). </p> <p><a href="http://lh5.ggpht.com/-aUYSJgR5QEA/UHPDPB1RJwI/AAAAAAAAASg/DjbXBCj_qeY/s1600-h/SharePoint%252520Error%25255B4%25255D.png"><img title="SharePoint Error" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="SharePoint Error" src="http://lh3.ggpht.com/-FKhF6cIT90k/UHPDRJI78xI/AAAAAAAAASo/3JM-MNPsDus/SharePoint%252520Error_thumb%25255B2%25255D.png?imgmax=800" width="484" height="232" /></a></p> <p>So you hopefully start up <a href="http://archive.msdn.microsoft.com/ULSViewer">ULS Viewer</a> and open up the relevant logs and search like a mad man after this specified correlation id. Sometimes you don’t find the provided correlation id in the log file you opened. Is there a easier way?</p> <p><a href="http://lh3.ggpht.com/-I0jyacH2zqw/UHPDSzRsVxI/AAAAAAAAASw/khDCW965LE0/s1600-h/ULS_Viewer%25255B3%25255D.png"><img title="ULS_Viewer" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="ULS_Viewer" src="http://lh5.ggpht.com/-tVhzEs5CDFk/UHPDV8VKKII/AAAAAAAAAS4/Y7N8WjkABOU/ULS_Viewer_thumb%25255B1%25255D.png?imgmax=800" width="476" height="279" /></a></p> <p>Yes and that is to use the SharePoint PowerShell command Merge-SPLogFile. According to the description of Merge-SPLogFile on <a href="http://technet.microsoft.com/en-us/library/ff607721.aspx">Microsoft TechNet</a>:</p> <p><em>“Combines trace log entries from all farm computers into a single log file on the local computer.”</em></p> <p>Let me explain how you can use this powerful command.</p> <h3>Basic Usage</h3> <p>Lets visualise a simple farm.</p> <p><a href="http://lh6.ggpht.com/-hnALWz1154I/UHPDXS7lK4I/AAAAAAAAATA/1KGGUSYdHto/s1600-h/Farm-Design3.jpg"><img title="Farm Design" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="Farm Design" src="http://lh3.ggpht.com/-4VGxJidZXD4/UHPDYqNtZaI/AAAAAAAAATI/jABo53pZr1I/Farm-Design_thumb1.jpg?imgmax=800" width="201" height="384" /></a></p> <p>As the example Farm image above we have two frontend servers, application server and database server. If I wanted to consolidated the last hour of SharePoint log entries from the front-end server and application server I would open up SharePoint Management Shell on one of the servers and type the following command:</p> <p>Merge-SPLogFile –Path “E:\SPLogs\MergedLogs.log” –Overwrite</p> <p><a href="http://lh3.ggpht.com/-sWpFKpKFNBA/UHPDZvv9b5I/AAAAAAAAATQ/fcmWrvzYNM4/s1600-h/Merge-SPLogFile_Basic%25255B3%25255D.png"><img title="Merge-SPLogFile_Basic" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="Merge-SPLogFile_Basic" src="http://lh3.ggpht.com/-BLaKtMi-Xfs/UHPDa43YpYI/AAAAAAAAATY/McYqR-N5ZUA/Merge-SPLogFile_Basic_thumb%25255B1%25255D.png?imgmax=800" width="510" height="272" /></a></p> <p>Now that was a very basic example to merge the various servers log files. More parameters are available on the <a href="http://technet.microsoft.com/en-us/library/ff607721.aspx">Microsoft TechNet article</a> for Merge-SPLogFile. For example Area, Category, Level, Message, StartTime, EndTime and more. </p> <h3>Finding Correlation ID</h3> <p>What the following example show is how to find the log entries for a specific correlation id:</p> <p>Merge-SPLogFile –Path “S:\SPLogs\MergedLogs.log” –Correlation 3ae2a6c0-da14-43a1-afda-5bb6bbff3d43 -Overwrite</p> <p><a href="http://lh5.ggpht.com/-4Ay52X98hlI/UHPDcFWl4HI/AAAAAAAAATg/iH8wfCwweL8/s1600-h/Merge-SPLogFile_Correlation%25255B3%25255D.png"><img title="Merge-SPLogFile_Correlation" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="Merge-SPLogFile_Correlation" src="http://lh6.ggpht.com/-w-2o11LpWzM/UHPDdYsZVwI/AAAAAAAAATo/Ro2tSo8HtYA/Merge-SPLogFile_Correlation_thumb%25255B1%25255D.png?imgmax=800" width="520" height="277" /></a></p> <p>Since the log files are merged with just the specified correlation id you can load the log file in <a href="http://archive.msdn.microsoft.com/ULSViewer">ULS Viewer</a> to easily view the entries. Please be aware that the log can be empty if the logging level is set to low for the SharePoint category. Just go to SharePoint Central Administration to increase the logging level.</p> <p><a href="http://lh3.ggpht.com/-SPbRjLfmxA4/UHPDfYBijOI/AAAAAAAAATw/9tEj9Th_mbw/s1600-h/ULS_Viewer_Correlation_Result%25255B3%25255D.png"><img title="ULS_Viewer_Correlation_Result" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="ULS_Viewer_Correlation_Result" src="http://lh3.ggpht.com/-jLtMKMfmiSA/UHPDiM8vwGI/AAAAAAAAAT4/olpsSGDZ8i4/ULS_Viewer_Correlation_Result_thumb%25255B1%25255D.png?imgmax=800" width="520" height="311" /></a></p> <p>As you can see in the image above the correlation id has 19 matching entries in the log file. Much less log entries to scroll through.</p> <h3>Summary</h3> <p>I hope this helps you on finding SharePoint errors quicker and easier. Let me know what your favourite commands and tools are for debugging SharePoint.</p> <p><a href="https://twitter.com/cecildt" target="_blank">@cecildt</a></p> Anonymoushttp://www.blogger.com/profile/09015555753126554122noreply@blogger.comtag:blogger.com,1999:blog-4041544417227362720.post-19144031256002137782012-08-28T13:46:00.001-07:002012-08-28T13:46:49.077-07:00SQL Server 2012– Slipstream Updates Has Changed<p>As of SQL Server 2012 it is easier to slipstream the latest service packs and cumulative updates to create new SQL Server installations. It is a slow process to first install SQL Server and then apply the latest updates afterwards.</p> <h3> </h3> <h3>The Usual Approach</h3> <p>The usual approach to slipstream <a href="http://blogs.msdn.com/b/petersad/archive/2009/02/25/sql-server-2008-creating-a-merged-slisptream-drop.aspx" target="_blank">SQL Server 2008</a> and <a href="http://blogs.msdn.com/b/petersad/archive/2010/05/31/rrr.aspx" target="_blank">SQL Server 2008 R2</a> has been documented on MSDN blogs where you needed to download update packages for all architectures and extract to a directory and copy over to the original SQL Server Setup files. Make changes to the configuration files to specify the updates and then proceed with the installation of SQL Server. It was basically allot of steps to do.</p> <h3>The Change Approach</h3> <p>Microsoft decided to change the way updates are applied with SQL Server 2012 installations. The new approach is much better. The change is documented on MSDN article about <a href="http://msdn.microsoft.com/en-us/library/cc707789.aspx" target="_blank">“Deprecated SQL Server Features of SQL Server 2012”</a>.</p> <p>The steps is as follow. Download the latest cumulative update for example <a href="http://support.microsoft.com/kb/2703275" target="_blank">CU2 for SQL Server 2012</a>. Then you need to run the downloaded file to extract to a directory C:\SQLUpdates for example. </p> <p><a href="http://lh3.ggpht.com/-WHa-nlFzxpE/UD0uF5maxsI/AAAAAAAAARM/yrS3X-VervI/s1600-h/SQL_Update%25255B4%25255D.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="SQL_Update" border="0" alt="SQL_Update" src="http://lh6.ggpht.com/-Al7-CI_CIBQ/UD0uGwdJ7JI/AAAAAAAAARU/LY2kGJcc_DE/SQL_Update_thumb%25255B2%25255D.png?imgmax=800" width="563" height="333"></a></p> <p>The CU2 download filename is “449398_intl_x64_2012_SQL_CU2.exe” and when you run the file it exact an file with the name “SQLServer2012-KB2703275-x64.exe”. You do not have to extract the the file again.</p> <p><a href="http://lh4.ggpht.com/-2nim_w2x9WU/UD0uHxBzAmI/AAAAAAAAARc/FfcwwAVk7DI/s1600-h/Updates_Directory%25255B4%25255D.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="Updates_Directory" border="0" alt="Updates_Directory" src="http://lh4.ggpht.com/-0pkGumJjVj4/UD0uJB2SQII/AAAAAAAAARk/kTRmXTiJ3KM/Updates_Directory_thumb%25255B1%25255D.png?imgmax=800" width="592" height="347"></a></p> <p>Now open command prompt and navigate to the original SQL Server 2012 setup files. In command prompt type the following command to start the setup:</p> <p><em>Setup.exe /Action=Install /UpdateEnabled=TRUE /UpdateSource="C:\SQLUpdates"</em></p> <p>The additional parameters are self explanatory, but lets go through them:</p> <ul> <li>Action = Specify that we want to perform an install of SQL Server 2012. <li>UpdateEnabled = Specify that the setup should include updates in installation. <li>UpdateSource = Specify location where updates are available</li></ul> <p><a href="http://lh3.ggpht.com/-_bLvagux6Lc/UD0uKde4s7I/AAAAAAAAARs/RFSLkdwjEDU/s1600-h/Setup_Command4.png"><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="Setup_Command" border="0" alt="Setup_Command" src="http://lh3.ggpht.com/-u61-rzB60tw/UD0uLWLEFaI/AAAAAAAAAR0/y90sc9UiRIQ/Setup_Command_thumb2.png?imgmax=800" width="530" height="136"></a></p> <p>After running the command you will see the default install screens for SQL Server 2012. After the setup checks screens you will see the Product Updates screen that list available updates in the specified directory.</p> <p><a href="http://lh6.ggpht.com/-nq1LiwLetIg/UD0uMUQrsGI/AAAAAAAAAR8/5FjrPLy0p8A/s1600-h/SQL_Setup_Product_Updates%25255B3%25255D.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="SQL_Setup_Product_Updates" border="0" alt="SQL_Setup_Product_Updates" src="http://lh5.ggpht.com/-1V6fyKZpVQQ/UD0uN5MkImI/AAAAAAAAASE/XFRa-lBT9Yo/SQL_Setup_Product_Updates_thumb%25255B1%25255D.png?imgmax=800" width="540" height="417"></a></p> <p>That is basically it. The SQL Server Setup will only use the updates that are available in the specified directory and automatically extract them. You don’t have to download all the available architectures, just the ones that you need.</p> <h3>Summary</h3> <p>In summary you can see that the new approach is much easier than before. You can still use the ConfigurationFile.ini and DefaultSetup.ini to specify available updates as well. I hope this change encourage you to always stay up to date with the latest service packs and cumulative updates as they come out.</p> <p><a href="https://twitter.com/cecildt" target="_blank">@cecildt</a></p> Anonymoushttp://www.blogger.com/profile/09015555753126554122noreply@blogger.comtag:blogger.com,1999:blog-4041544417227362720.post-88326870147340475572012-08-24T02:59:00.001-07:002012-08-24T02:59:53.766-07:00SQL Server 2012–Analysis Service Does not Start After Setup<p>I was busy setting up a new VM with SQL Server 2012 with the latest <a href="http://support.microsoft.com/kb/2703275" target="_blank">cumulative update (Build: 11.0.2325.0)</a> and all the features enabled for installation. On the end of the installation summary page it show that SQL Server Analysis Services failed. The installation did install the Analysis Service but viewing the SQL Server Services in SQL Server Configuration Manager it show the Analysis Service did not start, that is why the installation show failed. </p> <p><a href="http://lh6.ggpht.com/-ybPmb2YIjfc/UDdQfNIy73I/AAAAAAAAAQU/6bQDbNy62KM/s1600-h/Analysis-Service-Error5.png"><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="Analysis Service Error" border="0" alt="Analysis Service Error" src="http://lh6.ggpht.com/-WacCBboQci8/UDdQhHU6DJI/AAAAAAAAAQc/3HVeBwpH22s/Analysis-Service-Error_thumb3.png?imgmax=800" width="478" height="357"></a></p> <h3>Problem</h3> <p>I went and look into Windows Application Event Viewer for further details and the following error has been logged:</p> <p><em>Message-handling subsystem: The message manager for the default locale cannot be found. <br>The locale will be changed to US English. Message-handling subsystem: The message manager for the default locale cannot be found. The locale will be changed to US English. File system error: The following error occurred during a file operation: Access is denied. . (</em><a href="file://\\?\E:\Data\CryptKey.bin"><em>\\?\E:\Data\CryptKey.bin</em></a><em>).</em></p> <p>At first I thought there is some server locale issue. As you can see at the end of the message there is an “Access is denied” issue. Which is related to permissions to some resource. To understand why I get this error I need to explain my server setup.</p> <p>The newly created VM has a C drive and an additional E drive. As you know the C drive is for OS and program files. The E drive is where I put all the SQL Server databases files and folders. On the E drive I created the following directory structure:</p> <p><a href="http://lh4.ggpht.com/-upfdnc7rop8/UDdQiJ0civI/AAAAAAAAAQk/OOxqr0KBb1c/s1600-h/SQL_Folder_Structure%25255B3%25255D.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="SQL_Folder_Structure" border="0" alt="SQL_Folder_Structure" src="http://lh6.ggpht.com/-duzqXsOLjo8/UDdQjZSxgAI/AAAAAAAAAQs/Fj3fNeOX6W0/SQL_Folder_Structure_thumb%25255B1%25255D.png?imgmax=800" width="207" height="196"></a></p> <p>For each SQL Server Service I create dedicated accounts:</p> <ul> <li>SQL Engine Service: sql_eninge_service <li>SQL Analysis Service: sql_analysis_service <li>SQL Reporting Service: sql_report_serivce <li>SQL Agent Service: sql_report_service</li></ul> <h3>Solution</h3> <p>You get the picture. Now back to the “Access is denied” error. I had to give the SQL Analysis Service account write access on E:\Data and E:\Logs directory and then the SQL Analysis service started up successfully.</p> <p><a href="http://lh5.ggpht.com/-s48FKwXgNOI/UDdQkX_0DOI/AAAAAAAAAQ0/VUFL63J0e_k/s1600-h/Add-Permissions3.png"><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="Add Permissions" border="0" alt="Add Permissions" src="http://lh3.ggpht.com/-AqylsKVG1_w/UDdQl3U0eUI/AAAAAAAAAQ8/xF7Z4pOq2QI/Add-Permissions_thumb1.png?imgmax=800" width="297" height="363"></a></p> <h3>Summary</h3> <p>In summary if you create your own service accounts and have your own predefined folder structure you can get permission errors from SQL Server. Always keep your eye on Windows Application Event Viewer to see any SQL Server permission errors and give the right permissions to each service account.</p> <p>Cheerio!</p> Anonymoushttp://www.blogger.com/profile/09015555753126554122noreply@blogger.comtag:blogger.com,1999:blog-4041544417227362720.post-52216409648637550462012-08-15T04:18:00.001-07:002012-08-15T04:18:06.336-07:00SQL Server 2012–SQL Agent Service Cannot Start After Setup<p>I had a issue with SQL Server Agent Service that cannot start up after creating a new clean installation of SQL Server 2012 with the latest <a href="http://support.microsoft.com/kb/2703275" target="_blank">cumulative update (Build: 11.0.2325.0)</a>. My first step was to look at trusty old Windows Application Event Viewer to see what messages get logged when I try to start the SQL Server Agent Service.</p> <p> </p> <h3>Problem</h3> <p>In Windows Application Event Viewer the following error message is logged:</p> <p><em>OpenSQLServerInstanceRegKey:GetRegKeyAccessMask failed (reason 2).</em></p> <p>The problem is that the default account that is created by the SQL Server installation that is used by the SQL Server Agent Service does not have the correct permissions.</p> <p><a href="http://lh6.ggpht.com/-uVXUPSNa4WU/UCuFTKKOIcI/AAAAAAAAAPo/1n4EX1WePQQ/s1600-h/Agent-Start-Errors-Auto-fix5.png"><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="Agent Start Errors Auto fix" border="0" alt="Agent Start Errors Auto fix" src="http://lh5.ggpht.com/-7Gt7UTg7S5Y/UCuFVEUxR3I/AAAAAAAAAPw/r81o8yzdTDo/Agent-Start-Errors-Auto-fix_thumb3.png?imgmax=800" width="496" height="468"></a></p> <p> </p> <h3>Solution</h3> <p>The easy solution is to use the SQL Server Configuration Manager to change the SQL Agent Service account to Local Service and then the SQL Agent Service will start up successfully. </p> <p>My preferred approach is to create a dedicated domain account for example: sql_agent_service. Assign this account to the SQL Agent Service via SQL Server Configuration Manager. When you start the SQL Agent Service you will see that the service start up successfully.</p> <p>If you go back and view the Windows Application Event Viewer you will see the error again, but additional messages are logged where an advance configuration setting has been automatically changed in SQL Server 2012. The <a href="http://msdn.microsoft.com/en-us/library/ms178127.aspx" target="_blank">Agent XPs</a> configuration option has been enabled which allows the Agent Service to start up successfully.</p> <p><a href="http://lh4.ggpht.com/-DC5UZ0-GUXk/UCuFWFgE5yI/AAAAAAAAAP4/HxwlJY6fC5g/s1600-h/Auto-fix-Set-Agent-XPs3.png"><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="Auto fix Set Agent XPs" border="0" alt="Auto fix Set Agent XPs" src="http://lh6.ggpht.com/-gwSM1WAOqiA/UCuFa1cvwJI/AAAAAAAAAQA/INrWGzt4Hks/Auto-fix-Set-Agent-XPs_thumb1.png?imgmax=800" width="440" height="451"></a></p> <p>To make sure the error is gone, clear the Windows Application Event Viewer. Stop and start the SQL Server Agent Service and make sure there are no errors logged again.</p> <p>By default the advance Agent XPs configuration option is disabled on new installations. You should enable it to make sure the SQL Agent Service work correctly.</p> <p>Here is the TSQL to enable Agent XPs manually:</p><pre class="brush: sql;">sp_configure 'show advanced options', 1;<br>GO<br>RECONFIGURE;<br>GO<br>sp_configure 'Agent XPs', 1;<br>GO<br>RECONFIGURE<br>GO<br /></pre><br /><p> </p><br /><h3>Summary</h3><br /><p>In summary you should define dedicated accounts for each SQL Server Service up front before you install SQL Server 2012. This will allow you to know which account has permission issues when a SQL Server service cannot start up successfully. Always keep your eye on the Windows Application Event Viewer for SQL Server errors!</p><br /><p>Cheerio!</p> Anonymoushttp://www.blogger.com/profile/09015555753126554122noreply@blogger.comtag:blogger.com,1999:blog-4041544417227362720.post-91118434060269286632012-01-24T23:37:00.001-08:002012-01-24T23:37:21.219-08:00SQL Server Virtualization Notes<p>Virtualization of SQL Server these days are becoming more a reality and common practice. Usually if you you mention SQL Server and Virtualization in one sentence people will look at you as if you are a mad man.</p> <p>With this post I would like to talk about a couple of notes you need to consider when you virtualize SQL Server. When using a hypervisor to consolidate your SQL Servers into a virtualization environment you need to think about the impact on CPU, Memory, Storage and Network performance and management. </p> <p>Let’s break it a bit down further with some checkpoint.</p> <p><strong>CPU</strong></p> <ul> <li>Always ensure that you disable power management for CPUs in the BIOS of the physical servers. You want the full power of your CPU available at all times.</li> <li>In your Guest VMs make sure that the Power Management Plan is set to High performance.</li> <li>The different levels of CPU cache has a big performance impact. Try to use the latest CPUs that have big level 3 cache. Level 3 cache in the latest <a href="http://software.intel.com/sites/products/collateral/hpc/vtune/performance_analysis_guide.pdf" target="_blank">Intel CPU</a> are shared among the individual cores. This allow the hypervisor to reuse the same CPU to schedule work among the cores for your SQL Server virtual machine where certain SQL Server data is cache.</li> <li>Assign minimal virtual cores to your SQL Server virtual machine and scale up the CPU count as required when workload increases. This allow the hypervisor the reuse the same CPU socket where certain data can remain cache rather than distribute across all available CPU sockets where you will be hit by cache misses.</li> <li> Monitor for throttling of the CPU.</li> <li>Avoid affinity masking.</li> <li>Use <a href="http://www.cpuid.com/softwares/cpu-z.html" target="_blank">CPU-Z</a> to make sure your CPU is performing optimally.</li></ul> <p><strong>Memory</strong></p> <ul> <li>From your hypervisor reserve memory to your SQL Server virtual machine. This allow other virtual machines not to consume your memory and allow the Balloon driver not to force your SQL Server virtual machine under memory pressure to release memory.</li> <li>Set your SQL Server minimum and maximum memory according to your reserve memory. Don’t assign all available memory you must leave some head room for the Windows Operating System. </li></ul> <p><strong>Storage</strong></p> <ul> <li>Still apply the same <a href="http://technet.microsoft.com/en-gb/library/cc966534.aspx" target="_blank">best practices for SQL Server</a> database files.</li> <li>Try and stick to RAID10.</li> <li>You can use Pass-Trough disks in your hypervisor. Which give you slightly better performance than virtual disk drives. </li> <li>You can use Shared or Dedicated LUNs via your hypervisor. Depended on your business requirements.</li> <li>Correctly configure multi-pathing on your SAN.</li> <li>Avoid 1GB iSCSI for storage, try going higher.</li></ul> <p><strong>Network</strong></p> <ul> <li>Assign dedicated Network Card interfaces via you hypervisor to the SQL Server virtual machine.</li> <li>Make sure good practices are followed for network redundancy.</li> <li>Avoid multiple virtual machine using the same network interface.</li></ul> <p>These checkpoints are some of the common practices to follow when setting up SQL Server in a virtualization environment. Virtualization setup comes down to what you can afford and what your business requirements are.</p> <p>The key areas to successful deployments are:</p> <ol> <li>Always use the latest version of the vendors hypervisor.</li> <li>Follow the vendor’s best practices.</li> <li>Always and always monitor the physical environment and guest virtual machines for optimizing the performance.</li></ol> <p><strong>Microsoft Hyper-V</strong></p> <p>The Microsoft Hyper-V hypervisor does have its own best practices for deploying SQL Server. One feature that you should try and avoid is dynamic memory. You should always use static memory assignment for SQL Server virtual machines. </p> <p>Here are some documents to review if you are going to use Microsoft Hyper-V.</p> <ol> <li><a href="http://download.microsoft.com/download/D/2/0/D20E1C5F-72EA-4505-9F26-FEF9550EFD44/Best%20Practices%20for%20Running%20SQL%20Server%20with%20HVDM.docx" target="_blank">Running SQL Server with Hyper-V Dynamic Memory Best Practices and Considerations</a></li> <li><a href="http://download.microsoft.com/download/d/9/4/d948f981-926e-40fa-a026-5bfcf076d9b9/SQL2008inHyperV2008.docx" target="_blank">Running SQL Server 2008 in Hyper-V Best Practices and Performance Recommendations</a></li> <li><a href="http://download.microsoft.com/download/D/F/8/DF89D22D-39C8-4728-A990-3BD4467891B7/HighPerformanceSQLServerWorkloadsOnHyper-V_Final.docx" target="_blank">High Performance SQL Server Workloads on Hyper-V</a></li></ol> <p><strong>VMware vSphere</strong></p> <p>The VVMware vSphere hypervisor has its own best practices for deploying SQL Server. A very nice feature that vSphere has is memory compression. This feature is where multiple pages in memory that are the same is removed from memory. Only keeping one copy in memory. This is a great benefit for Operating System pages in memory, but no real benefit specifically towards SQL Server. </p> <p>Here are some documents to review if you are going to use VMware vSphere.</p> <ol> <li><a href="http://www.vmware.com/files/pdf/solutions/SQL_Server_Availability_Guide_FINAL.pdf" target="_blank">Availability Guide for Deploying SQL Server on VMware vSphere</a></li> <li><a href="http://www.vmware.com/resources/techresources/10033" target="_blank">Performance and Scalability of SQL Server on VMware vSphere</a></li> <li><a href="http://www.vmware.com/files/pdf/sql_server_best_practices_guide.pdf" target="_blank">SQL Server on VMware Best Practices Guide</a></li></ol> <p><strong>Conclusion</strong></p> <p>On the end there are allot of guidance from the individual vendors for optimal deployment of SQL Server in an virtualization environment. There are many benefits like cost savings and management in using virtualization. I would really recommend that you try setup a test environment to see the benefits.</p> <p>Performance is always a concern, but at the rate at which hardware performance are increasing the little bit of performance impact you experience right now with virtualization will be a thing of the past with new hardware. Especially with enterprise SSD disk drives that are coming out at a good price.</p> <p>One person that I follow that provides brilliant content on SQL Server virtualization is <a href="http://www.brentozar.com/" target="_blank">Brent Ozar</a>. He has many <a href="http://www.brentozar.com/community/virtualization-best-practices/" target="_blank">articles and videos on virtualization</a>.</p> <p>If you have any comment or questions about SQL Server virtualization please feel free to contact me.</p> <p>Cheerio!</p> Anonymoushttp://www.blogger.com/profile/09015555753126554122noreply@blogger.comtag:blogger.com,1999:blog-4041544417227362720.post-59259221716943483682012-01-18T01:46:00.001-08:002012-01-18T01:46:13.541-08:00Journey for MCM on SQL Server 2008<p>Today is the start of a very exciting and challenging journey to become a <a href="http://www.microsoft.com/learning/en/us/certification/master-sql-path.aspx" target="_blank">Microsoft Certified Master on SQL Server 2008</a>. This post is about my planning on achieving the certification.</p> <p><strong>The Motivation</strong></p> <p>Over the years I have worked in various environments that involved development with SharePoint, BizTalk, Integration, Web and custom development. All of them had one thing in common and that is they all use SQL Server. I always enjoy and have allot of passion working within SQL Server. Always learning the little bits about the ins and outs of SQL Server is fun. Working with SQL Server all over the years came to a point that I ask myself how can I improve myself to be better at what I do and know. That has put my focus on achieving the Microsoft Certified Master on SQL Server 2008.</p> <p><strong>The Schedule</strong></p> <p>How am I going to achieve this and by when? My personal schedule is to write the MCM on SQL Server Knowledge Exam in the first week of May 2012. If I pass that exam then it will onto the MCM on SQL Server Lab exam. From today it leaves me with roughly 3 months for studying. </p> <p>As mentioned by other MCMs that studying alone is not enough. You do need years of experience working with SQL Server.</p> <p><strong>The Resources</strong></p> <p>Where are the resources? There are various books, whitepapers and blogs that needs to be studied that will help with the exams. On the <a href="http://www.microsoft.com/learning/en/us/certification/master-sql-path.aspx" target="_blank">official page</a> and from <a href="http://www.sqlskills.com/MCM.asp" target="_blank">SQLskills.com</a> you get links to the recommended resources. There are also training programs available that can be attended for preparation to the Microsoft Certified Master on SQL Server 2008 exams. </p> <p><strong>The OneNote</strong></p> <p>There are so many resources available on the internet that it can be a big tasks to get these resource organized. I took the time in my planning to organise the resources into a <a href="http://office.microsoft.com/en-us/onenote/" target="_blank">Microsoft OneNote</a> document. You can download it from <a href="http://dl.dropbox.com/u/4406115/MCM%20SQL/SQL%20MCM%20Training.one" target="_blank">here</a>.</p> <p>The OneNote document is divided into sections namely:</p> <ul> <li>Videos</li> <li>Stairways Series</li> <li>Books</li> <li>Blogs</li> <li>SQLSkills Training</li></ul> <p>The videos section includes the links to the recommended readiness videos for Microsoft Certified Master on SQL Server 2008. The Stairways Series section is links the various topics about SQL Server that is provided by <a href="http://www.sqlservercentral.com/stairway/" target="_blank">SQLServerCentral.com</a>. The Books section has links to the recommended books for reading. The White Papers section are the whitepapers that must be read for the exams. The Blogs section is links to some additional reading for the exam. Lastly the SQLskills Training section has been broken down to sub sections with the various resources links that is mentioned on <a href="http://www.sqlskills.com/MCM.asp" target="_blank">SQLskills MCM page</a>.</p> <p>If you are also going to do the Microsoft Certified Master on SQL Server 2008 exams I hope this document can help you on your journey. Also if you find resources that I might have missed let me know and I will update the document.</p> <p>Again here is the full link to the document: <a title="http://dl.dropbox.com/u/4406115/MCM%20SQL/SQL%20MCM%20Training.one" href="http://dl.dropbox.com/u/4406115/MCM%20SQL/SQL%20MCM%20Training.one">http://dl.dropbox.com/u/4406115/MCM%20SQL/SQL%20MCM%20Training.one</a></p> <p><strong><a href="http://lh4.ggpht.com/-pEc4uCZ1bfI/TxaU3VKISzI/AAAAAAAAANM/PSLwTI74rag/s1600-h/mcm_onenote%25255B5%25255D.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="mcm_onenote" border="0" alt="mcm_onenote" src="http://lh4.ggpht.com/-RLfhZ7SYKZw/TxaU47oms3I/AAAAAAAAANQ/ptYSrfDKm0A/mcm_onenote_thumb%25255B3%25255D.png?imgmax=800" width="630" height="410"></a></strong></p> <p><strong>Conclusion</strong></p> <p>In conclusion as I mentioned in the beginning of this post, it is going to be a very exciting and challenging journey to be come a Microsoft Certified Master on SQL Server 2008. I will continue to put up posts as my learning progresses on the topics of SQL Server. For those who also attempting these exams as well, best of luck and see you at the other end.</p> <p>Cheerio! </p> Anonymoushttp://www.blogger.com/profile/09015555753126554122noreply@blogger.comtag:blogger.com,1999:blog-4041544417227362720.post-87116603482214485692011-09-09T00:38:00.001-07:002011-09-09T00:38:31.658-07:00Deploy SharePoint 2010 the Easy Way<p><strong>Intro</strong></p> <p>If you are a SharePoint Developer or Administrator you know it can take a long time to deploy SharePoint 2010 and difficult to remember everything that you have to configure in SharePoint 2010. A easy deployment solution is available to quickly deploy SharePoint 2010.</p> <p><strong>The Solution</strong></p> <p>The easy deployment solution is the <a href="http://www.codeplex.com/" target="_blank">CodePlex</a> project namely <a href="http://autospinstaller.codeplex.com/" target="_blank">AutoSPInstaller</a>. This project use the power of PowerShell to automate deployment and configuration of SharePoint 2010. The PowerShell scripts allows you to deploy SharePoint 2010 with prerequisites, <a href="http://support.microsoft.com/kb/2460045" target="_blank">service packs</a> and updates, <a href="http://technet.microsoft.com/en-us/forefront/bb734828" target="_blank">Forefront Security</a>, <a href="http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=3411" target="_blank">Language Packs</a>, <a href="http://technet.microsoft.com/en-us/library/ff431687.aspx" target="_blank">Office Web Apps</a> and <a href="http://www.adobe.com/support/downloads/detail.jsp?ftpID=4025" target="_blank">PDF iFilter</a> with icon. </p> <p>For a detailed guide to use the AutoSPInstaller scripts go to Tobias Lekman post: <a href="http://blog.lekman.com/2010/11/automated-sharepoint-2010-installations.html">http://blog.lekman.com/2010/11/automated-sharepoint-2010-installations.html</a></p> <p>These scripts allow you to configure SharePoint 2010 once according to your requirements and use it over and over again.</p> <p><strong>Developer Setup</strong></p> <p>What about a basic SharePoint 2010 setup for development? Well, Microsoft created a easy setup script to setup the following on a machine or VM:</p> <ul> <li>SharePoint Server 2010 + Pre-requisites (Standalone)</li> <li>Visual Studio 2010 Ultimate Edition</li> <li>Silverlight 4 Tools for Visual Studio</li> <li>Expression Studio 4 Ultimate</li> <li>Open XML SDK</li> <li>Visual Studio SDK</li> <li>Visual Studio SharePoint Power Tools</li> <li>Office 2010 Professional Plus</li> <li>SharePoint Designer 2010</li> <li>Visio 2010</li></ul> <p>The download location for SharePoint 2010 Easy Setup Script: <a href="http://www.microsoft.com/download/en/details.aspx?id=23415">http://www.microsoft.com/download/en/details.aspx?id=23415</a></p> <p>Hope these scripts make your life easier as a SharePoint 2010 Developer and Administrator.</p> <p>Cheerio!</p> Anonymoushttp://www.blogger.com/profile/09015555753126554122noreply@blogger.comtag:blogger.com,1999:blog-4041544417227362720.post-26603432482372587652011-09-09T00:08:00.001-07:002012-08-12T01:31:57.608-07:00SQL SERVER 2012 New Function - IIF<a href="http://lh6.ggpht.com/-rBmaJgsrJrU/Tmm7dq6yisI/AAAAAAAAAL4/VFxbJouxaiY/s1600-h/Denali_thumb2.jpg"><img alt="Denali_thumb" border="0" height="72" src="http://lh4.ggpht.com/-N6T6y_3FheA/Tmm7eg0c7rI/AAAAAAAAAL8/R9bVdjgOm2I/Denali_thumb_thumb.jpg?imgmax=800" style="background-image: none; border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="Denali_thumb" width="244" /></a><br />
<strong>Intro</strong><br />
Today I’m looking at the new TSQL function IIF that is available in SQL Server 2011 ”Denali”. IIF stand for “Inline IF”. IIF is a shorthand way for writing a CASE statement in TSQL.<br />
<strong><a href="http://msdn.microsoft.com/en-us/library/hh213574(v=SQL.110).aspx" target="_blank">MSDN Description</a></strong><br />
<em>Returns one of two values, depending on whether the Boolean expression evaluates to true or false.</em><br />
Syntax Format: IIF ( boolean_expression, true_value, false_value )<br />
The first parameter is a Boolean expression e.g. Age > 21. The second parameter is return value if the expression is true and the third parameter is the return value if the expression is false.<br />
<strong>TSQL Example</strong><br />
Basic example for IIF function:<br />
<pre class="brush: sql;">DECLARE @age INT = 18;
SELECT IIF(@age > 21,'Allowed','Not allowed');</pre>
<br />
You can also have nested IIF. Nested IIF can only be nested up to a maximum level of 10. This is because the CASE statement has the same limitation.<br />
<pre class="brush: sql;">DECLARE @age INT = 28,
@firsttime BIT = 1;
SELECT IIF(@age > 21,
IIF(@firsttime = 1, 'Free drink', 'No free drink'),
'Not allowed');</pre>
<pre class="brush: sql;"> </pre>
<br />
<strong>Practical Example</strong><br />
<br />
My practical examples are using the AdventureWorks2008R2 database for Denali which is available <a href="http://msftdbprodsamples.codeplex.com/" target="_blank">here</a>. Let look at a practical example for IIF function:<br />
<pre class="brush: sql;">SELECT pdt.Name,
IIF(SUM(piy.Quantity) < pdt.SafetyStockLevel, 'Low Stock', 'Normal Stock') AS 'Stock Status'
FROM [AdventureWorks2008R2].[Production].[Product] pdt
LEFT OUTER JOIN
[AdventureWorks2008R2].[Production].[ProductInventory] piy ON pdt.ProductID = piy.ProductID
GROUP BY pdt.Name, pdt.SafetyStockLevel</pre>
<br />
As you can see the IIF function makes it allot easier to use than the CASE statement and helps to make your TSQL code smaller and more understandable. Let me know what you think about this function addition in SQL Server 2011 Denali or if you have any questions.<br />
<br />
Cheerio!Anonymoushttp://www.blogger.com/profile/09015555753126554122noreply@blogger.comtag:blogger.com,1999:blog-4041544417227362720.post-80616043339517080772011-08-28T05:10:00.001-07:002012-08-12T01:32:26.275-07:00SQL SERVER 2012 New Function – EOMONTH<a href="http://lh5.ggpht.com/-YTEvANYNyMY/Tlowkx9nF3I/AAAAAAAAALs/H2Pt3R6_Bvs/s1600-h/Denali%25255B2%25255D.jpg"><img alt="Denali" border="0" height="72" src="http://lh3.ggpht.com/-UgLUn7rCMV4/Tlowlk8C6PI/AAAAAAAAALw/YxQLHIuO7yM/Denali_thumb.jpg?imgmax=800" style="background-image: none; border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="Denali" width="244" /></a><br />
<strong>Intro</strong><br />
As we all are waiting in excitement for the final release of SQL Server “Denali” I’m going to look at the new TSQL functions it brings for developers. The first function is EOMONTH. EOMONTH stand for “End Of MONTH”.<br />
<strong><a href="http://msdn.microsoft.com/en-us/library/hh213020(v=SQL.110).aspx" target="_blank">MSDN Description</a></strong><br />
<em>Returns the last day of the month that contains the specified date, with an optional offset.</em><br />
Syntax Format: EOMONTH ( start_date [, month_to_add ] )<br />
Start date specify the date for which to return the last day of the same month. Month to add is an optional parameter to add months to the specified start date. <br />
<strong>TSQL Example</strong><br />
Basic example for EOMONTH function:<br />
<pre class="brush: sql;">DECLARE @start_date DATETIME = '08/10/2011';
SELECT EOMONTH (@start_date) AS Result; --Result: 2011-08-31 00:00:00.000</pre>
<br />
As you can see when I specify the 10 August 2011 the last date of the month is 31 August 2011. You can specify the start date as DATETIME or as a VARCHAR value. EOMONTH will do a implicit conversion of the VARCHAR to DATETIME.<br />
<br />
Example to get next month last date:<br />
<pre class="brush: sql;">DECLARE @start_date DATETIME = '08/10/2011';
SELECT EOMONTH (@start_date, 1) AS Result; --Result: 2011-09-30 00:00:00.000</pre>
<br />
Now by adding the optional parameter of 1 to the EOMONTH function you ask for the next month last date. As the example shows the result is 30 September 2011 for the input of 10 August 2011. If I change it to 2 then I will get the second month after the specified date.<br />
<br />
Example to get previous month last date:<br />
<pre class="brush: sql;">DECLARE @start_date DATETIME = '08/10/2011';
SELECT EOMONTH (@start_date, -1) AS Result; --Result: 2011-07-31 00:00:00.000</pre>
<br />
This example show how to get the previous month last date from the specified input date. You simply make the optional parameter minus. The input was again 10 August 2011 and the result for EOMONTH function was 31 July 2011.<br />
<br />
<strong>Practical Example</strong><br />
<br />
My practical examples are using the AdventureWorks2008R2 database for Denali which is available <a href="http://msftdbprodsamples.codeplex.com/" target="_blank">here</a>. Let look at a practical example for EOMONTH function:<br />
<pre class="brush: sql;">DECLARE @begin_date DATETIME = '01/01/2007',
@end_date DATETIME;
SELECT @end_date = EOMONTH(@begin_date, 3); --Result: 2007-04-30 00:00:00.000
SELECT SUM(TotalDue) AS 'First Quarter Purchase Total' --Result: 145291.7959
FROM [AdventureWorks2008R2].[Purchasing].[PurchaseOrderHeader]
WHERE OrderDate > @begin_date
AND OrderDate < @end_date</pre>
<br />
In this example I calculate the first quarter purchase total for the year 2007. I specify a start date and use the EOMONTH function to calculate the last date of the quarter. Now it is easy to just sum up the TotalDue column for records between the begin date and end date.<br />
<br />
As you can see the EOMONTH function makes it allot easier to get the last day of a month and it helps to make your TSQL code smaller and more understandable. Let me know what you think about this function addition in SQL Server 2011 Denali or if you have any questions.<br />
<br />
Cheerio!Anonymoushttp://www.blogger.com/profile/09015555753126554122noreply@blogger.comtag:blogger.com,1999:blog-4041544417227362720.post-68766807792798684912011-08-27T11:03:00.001-07:002011-08-27T11:03:55.059-07:00Powermockup: Ui Wireframe toolkit in PowerPoint<p>I found the perfect solution for UI mock-ups namely <a href="http://www.powermockup.com/" target="_blank">PowerMockup</a>.There is a whole bunch of offline and online tools to create UI mock-ups. Using these tools are great, but clients are not always happy with these tools. Clients usually consider its something new they have to learn.</p> <p><a href="http://lh4.ggpht.com/-OUtHkIP7kOQ/TlkxXCKi5wI/AAAAAAAAALM/mGMsFlSnVFY/s1600-h/logo%25255B2%25255D.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="logo" border="0" alt="logo" src="http://lh3.ggpht.com/-j483M8nftkk/TlkxZE_N4YI/AAAAAAAAALQ/KaGq4iLXdU8/logo_thumb.png?imgmax=800" width="126" height="152"></a></p> <p>With PowerMockup everything happens inside <a href="http://office.microsoft.com/en-us/powerpoint/" target="_blank">Microsoft PowerPoint</a>. Client is happy because its a tool they know. You design inside PowerPoint and then just send the slides to clients and then they can view your designs. The clients can also move the elements around with or without having PowerMockup installed, but if they don’t have PowerMockup they cannot add new element.</p> <p><strong>The Toolset</strong></p> <p>Let me show you a couple of screenshots of PowerMockup. Firstly you need to go and <a href="http://www.powermockup.com/" target="_blank">download PowerMockup</a>. You do get a trial period and the cost as of 27 August 2011 to buy is:</p> <ul> <li>1 User = $39.95</li> <li>5 Users = $119.95</li> <li>10 Users = $199.90</li></ul> <p>When you install PowerMockup you will see a new menu option in PowerPoint.</p> <p><a href="http://lh6.ggpht.com/-9L7rTOZQ5ds/TlkxaKA0HJI/AAAAAAAAALU/6LHV6M_C7Pg/s1600-h/Menu%25255B6%25255D.jpg"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="Menu" border="0" alt="Menu" src="http://lh5.ggpht.com/-YPjF_tiOFk8/TlkxbRd-X3I/AAAAAAAAALY/HjgTVY-i8oU/Menu_thumb%25255B4%25255D.jpg?imgmax=800" width="630" height="135"></a></p> <p>The Show Stencil Library button you have to click to view all the stencil items you can use for your UI mock-ups. The stencil library will appear on your right hand side of PowerPoint.</p> <p><a href="http://lh5.ggpht.com/--LP_4ukIwRI/TlkxdMw3kPI/AAAAAAAAALc/xZXaP7EUDZ4/s1600-h/Stencils%25255B6%25255D.jpg"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="Stencils" border="0" alt="Stencils" src="http://lh4.ggpht.com/-erz1VJXghQA/TlkxeVctrAI/AAAAAAAAALg/W214SOXxnqQ/Stencils_thumb%25255B4%25255D.jpg?imgmax=800" width="312" height="542"></a></p> <p>The stencil library contains various items to use. The items are grouped as Custom Shapes, Containers, Graphics, Icons, Markup, Navigation and Text. You can create your own item and add it to the stencil library which you can export and import. PowerMockup also provides a nifty little search box at the top to quickly search for a specific item.</p> <p>Here is an rough example design I did to show some of PowerMockup items.</p> <p><a href="http://lh4.ggpht.com/-IpgT1YnmP_o/TlkxglMsYII/AAAAAAAAALk/8c4wf5TueaU/s1600-h/BlogDesignExp%25255B5%25255D.jpg"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="BlogDesignExp" border="0" alt="BlogDesignExp" src="http://lh5.ggpht.com/-KO3c3LepUxA/TlkxiB7DMSI/AAAAAAAAALo/x5t0nAHCr9k/BlogDesignExp_thumb%25255B3%25255D.jpg?imgmax=800" width="630" height="455"></a></p> <p>If you have a change, take a look at this great add on. You will definitely enjoy it and I had clients that enjoyed the experience of viewing their UI designs inside PowerPoint.</p> <p>Cheerio!</p> Anonymoushttp://www.blogger.com/profile/09015555753126554122noreply@blogger.comtag:blogger.com,1999:blog-4041544417227362720.post-40771688309046935752011-08-27T06:33:00.001-07:002011-08-27T06:33:02.663-07:00Microsoft Research: Trinity Graph Database<p><a href="http://lh5.ggpht.com/-rbBn5gZXv7w/Tljx7X3T7HI/AAAAAAAAAK8/k3nTah4r2U0/s1600-h/trinity-logo%25255B3%25255D.jpg"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="trinity-logo" border="0" alt="trinity-logo" src="http://lh5.ggpht.com/-Nu0D9yjYf8A/Tljx8FYQ_AI/AAAAAAAAALA/o4SLbPt43HI/trinity-logo_thumb%25255B1%25255D.jpg?imgmax=800" width="83" height="82"></a></p> <p>I found myself wondering around the Microsoft Research website the other day and found the Trinity project. Trinity is a graph database and computation platform over distributed memory cloud. Trinity currently have a release package of version 0.2 available for download. If you want to find out some more details visit the official site: <a href="http://research.microsoft.com/en-us/projects/trinity/default.aspx">http://research.microsoft.com/en-us/projects/trinity/default.aspx</a> </p> <p><strong>Key features of Trinity</strong></p> <ul> <li>Use Hypergraph Data Model</li> <li>Distributed: Deployed to one more machines</li> <li>Memory-based graph store with rich database features.</li> <li>Highly Concurrent Online Query processing</li> <li>ACI transaction support</li> <li>Parallel graph processing system</li></ul> <p><strong>The Interest</strong></p> <p>I never really took notice until I read through the documentation and understand the practical usage. Graph databases are used by all the big companies like Microsoft, Google and Facebook. A Graph database is a database that uses graph structures with nodes, edges and properties to represent and store information.</p> <p><a href="http://lh4.ggpht.com/-DxIcHi2AjOU/Tljx_iW1AaI/AAAAAAAAALE/INSzxlYlnyE/s1600-h/GraphDatabase_PropertyGraph%25255B4%25255D.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="GraphDatabase_PropertyGraph" border="0" alt="GraphDatabase_PropertyGraph" src="http://lh6.ggpht.com/-Hdbv4m3xxgg/TljyC90inqI/AAAAAAAAALI/kyLSL5Lr9fc/GraphDatabase_PropertyGraph_thumb%25255B2%25255D.png?imgmax=800" width="586" height="306"></a></p> <p>On Wikipedia you will find a whole list of Graph databases implementations: <a href="http://en.wikipedia.org/wiki/Graph_database">http://en.wikipedia.org/wiki/Graph_database</a></p> <p><strong>Where to know</strong></p> <p>You might ask yourself why do I write this entry about Trinity. Well, for starters all developers that use any Microsoft technology should take note of Trinity. Trinity can help to better structure information on your next project. I can see how Trinity can be used along side SharePoint and SQL Server. It would be interesting to see how you may be able to take existing SQL Server data to Trinity. I could also see how BI developers can take various data sources and structure the data inside Trinity to do their magic easier. I also believe that Trinity might be the solution service on Azure for graph database usage.</p> <p>Since I’m a service integration person, I find it difficult to think how this will benefit any service integration project or be used along side BizTalk. I might be wrong?</p> <p>I think Trinity has a bright future ahead. Hope Microsoft does not kill off this research project. Let me know what you think about graph databases and specifically the Trinity project.</p> <p> </p> <p>Cheerio!</p> Anonymoushttp://www.blogger.com/profile/09015555753126554122noreply@blogger.comtag:blogger.com,1999:blog-4041544417227362720.post-35810697479068514712011-08-21T22:38:00.001-07:002011-08-21T22:54:46.097-07:00Devs4devs Event–TSQL Improvements in SQL Server 2011 "Denali"<p><a href="http://lh5.ggpht.com/-ObtSTsjboKE/TlHrWsulTrI/AAAAAAAAAJM/w914Kyq_fZg/s1600-h/Denali%25255B5%25255D.jpg"><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="Denali" border="0" alt="Denali" src="http://lh6.ggpht.com/-985dO3LDMiI/TlHrXROzbrI/AAAAAAAAAJQ/C6j7GR8rMOo/Denali_thumb%25255B1%25255D.jpg?imgmax=800" width="244" height="72"></a></p> <p>My latest presentation was at Microsoft Devs4Devs event. I discussed some of the new T-SQL functions that is available in SQL Server 2011 “Denali”. Firstly I want to thank Dave Russell from Microsoft for the opportunity. Also thanks must go to all the community members who attended the day and for your feedback.</p> <p>My Slides is available <a href="http://dl.dropbox.com/u/4406115/Devs4Devs%202011/TSQL%20in%20SQL%202011%20Denali.pptx" target="_blank">here</a>.</p> <p>My T-SQL Code snippets <a href="http://dl.dropbox.com/u/4406115/Devs4Devs%202011/Workshop%20Snippets.zip" target="_blank">here</a>.</p> <p>See you guys at the next community event.</p> <p>Cheerio!</p> Anonymoushttp://www.blogger.com/profile/09015555753126554122noreply@blogger.comtag:blogger.com,1999:blog-4041544417227362720.post-37024681170164680602011-08-08T05:52:00.001-07:002011-08-08T05:52:35.278-07:00Lync Server 2010– Topology Publish Error<p>I had a very interesting experience try to setup Lync Server 2010 for my latest project. Using Lync Server 2010 with SharePoint 2010 environment. Very powerful combination for user collaboration.</p> <p>Anyway, I got a very strange error in publishing my Lync Topology:</p> <p><em>The existing topology identifies serverA.domain as the Central Management Store, but the topology that you are trying to publish identifies serverB.domain as the Central Management Store. The Central Management Stores must match before the topology can be published.</em></p> <p>The white blotches on the images are server FQDN that I needed to hide.</p> <p><a href="http://lh3.ggpht.com/-by9Ux33XdGE/Tj_b5t1hAwI/AAAAAAAAAG0/S7i0DHGZU4M/s1600-h/Deployment-Error5.png"><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="Deployment Error" border="0" alt="Deployment Error" src="http://lh6.ggpht.com/-5zi3Jhqe_Ic/Tj_b7TgJUyI/AAAAAAAAAG4/Myhv-7bcj14/Deployment-Error_thumb3.png?imgmax=800" width="447" height="398"></a></p> <p>The reason for this might be that you specified the wrong FQDN and try to publish the Lync topology before. Firstly make sure you use the correct FQDN for the server that is hosting the Central Management Store.</p> <p>Open up Lync Server Management Shell and type the following command to get the currently registered Central Management Store location:</p> <p><em>Get-CsConfigurationStoreLocation</em></p> <p><a href="http://lh3.ggpht.com/-twgn_xbjPj8/Tj_b8qSBzxI/AAAAAAAAAG8/VFSDkub20Xo/s1600-h/Command-Get-Store3.png"><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="Command Get Store" border="0" alt="Command Get Store" src="http://lh4.ggpht.com/-d70hpnvLaKQ/Tj_b-BKcuwI/AAAAAAAAAHA/t1hLHFOsD0Y/Command-Get-Store_thumb1.png?imgmax=800" width="470" height="251"></a></p> <p>To remove the registered Central Management Store location type in the following command: </p> <p><em>Remove-CsConfigurationStoreLocation</em></p> <p><a href="http://lh6.ggpht.com/-Kb9mmZOQJiQ/Tj_b_Cn6YFI/AAAAAAAAAHE/UT7IZaVcZRc/s1600-h/Command-Remove-Store3.png"><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="Command Remove Store" border="0" alt="Command Remove Store" src="http://lh4.ggpht.com/-C_FSVbfqk0A/Tj_cBHdcRcI/AAAAAAAAAHI/HOubVt2Vd7s/Command-Remove-Store_thumb1.png?imgmax=800" width="438" height="234"></a></p> <p>After running these commands you can attempt to publish your Lync Topology again and see the success message.</p> <p><a href="http://lh6.ggpht.com/-cQbaal-ZEEo/Tj_cCdwt5jI/AAAAAAAAAHM/aJhmxKjWHLE/s1600-h/Publish%252520Success%25255B3%25255D.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="Publish Success" border="0" alt="Publish Success" src="http://lh6.ggpht.com/-dc3tzp6iYWk/Tj_cEM0usTI/AAAAAAAAAHQ/DG0zr0BGkps/Publish%252520Success_thumb%25255B1%25255D.png?imgmax=800" width="458" height="377"></a></p> <p>Hope this help you with fixing Lync Topology publishing problems.</p> <p>Cheerio!</p> Anonymoushttp://www.blogger.com/profile/09015555753126554122noreply@blogger.comtag:blogger.com,1999:blog-4041544417227362720.post-29209098106732180452011-07-28T22:30:00.001-07:002011-07-28T22:30:00.498-07:00Get started with Node.js on Windows<p>Node.js has released an exe version that can be run on Windows to execute JavaScript on the server. The current version is 0.5.2. On the internet there are various articles on what Node.js is and how to use it.</p> <p>Microsoft has recently partnered with <a href="http://www.joyent.com/">Joyent</a> to get Node.js running on Windows. Maybe in the future to run on the Microsoft Azure platform (<em>My speculation)</em>.</p> <p>To get started head over to the Node.js site and <a href="http://www.nodejs.org/#download">download the exe</a>. Create an directory to put the exe.</p> <p><a href="http://lh4.ggpht.com/-66nvz1IZPFk/TjJFMDTZzRI/AAAAAAAAAGU/oj6nCTiVJ08/s1600-h/Folder%252520Directory%25255B3%25255D.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="Folder Directory" border="0" alt="Folder Directory" src="http://lh6.ggpht.com/-26taujOxXss/TjJFN7VAO9I/AAAAAAAAAGY/KMmK6_hSc44/Folder%252520Directory_thumb%25255B1%25255D.png?imgmax=800" width="483" height="303"></a></p> <p>Create a folder next to the exe for you first Node.js project like Hello. Inside the Hello folder you create an server.js file to create your first web server application.</p> <p>Here is an very basic example</p> <p><a href="http://lh5.ggpht.com/-c5HxskZ0fwY/TjJFOz6nsLI/AAAAAAAAAGc/eKrWXVTBxx8/s1600-h/Server%252520Code%25255B3%25255D.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="Server Code" border="0" alt="Server Code" src="http://lh4.ggpht.com/-NZiWSctIoS4/TjJFQybSGTI/AAAAAAAAAGg/dOklsImbvfE/Server%252520Code_thumb%25255B1%25255D.png?imgmax=800" width="481" height="175"></a></p> <p>To run the Node.js example open up PowerShell and run the following command:</p> <p><em>.\node.exe .\Hello\server.js</em></p> <p><a href="http://lh4.ggpht.com/-GookKxYW31A/TjJFRhavaGI/AAAAAAAAAGk/K1JbGaEoB7E/s1600-h/Run%252520in%252520Powershell%25255B3%25255D.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="Run in Powershell" border="0" alt="Run in Powershell" src="http://lh6.ggpht.com/-7Uf9GrcMdiI/TjJFTNYPldI/AAAAAAAAAGo/gYJXh-D5GoY/Run%252520in%252520Powershell_thumb%25255B1%25255D.png?imgmax=800" width="479" height="158"></a></p> <p>Now open your favourite browser and browse to the URL you specified in the source file.</p> <p><a href="http://lh6.ggpht.com/-o9iG5pj5aU8/TjJFUKcPdYI/AAAAAAAAAGs/N_oA8_tTnTE/s1600-h/Browser%252520Display%25255B3%25255D.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="Browser Display" border="0" alt="Browser Display" src="http://lh3.ggpht.com/-s-8UIxKTveQ/TjJFV-4lhiI/AAAAAAAAAGw/wquiA9MCXaw/Browser%252520Display_thumb%25255B1%25255D.png?imgmax=800" width="480" height="194"></a></p> <p>That is it! Your first Node.js application running from Windows. Very easy.</p> <p>Here are some additional links to read:</p> <p><a href="http://nodebeginner.org/">http://nodebeginner.org/</a></p> <p><a href="http://howtonode.org/">http://howtonode.org/</a></p> <p><a href="http://nodeguide.com/">http://nodeguide.com/</a></p> <p><a href="https://github.com/joyent/node/wiki/">https://github.com/joyent/node/wiki/</a></p> <p>I will later follow up with a full blow HTML application.</p> <p>Cheerio!</p> Anonymoushttp://www.blogger.com/profile/09015555753126554122noreply@blogger.comtag:blogger.com,1999:blog-4041544417227362720.post-69848627060351712702011-07-28T21:02:00.001-07:002011-07-28T21:02:25.647-07:00VirtualBox Tips and Tricks<p>Here are a couple of tips and tricks for <a href="http://www.virtualbox.org/">Oracle VirtualBox</a>. At the time of writing this blog the latest version of VirtualBox is 4.1. The <a href="http://www.virtualbox.org/manual/ch08.html">VirtualBox commands</a> that follow is run in Windows but is more or less the same in Linux environments.</p> <p><strong>Tip 1 – Clone existing Virtual disk</strong></p> <p>In command line go to the path of where VirtualBox is installed because you are going to need access to the program VBoxManage. Windows command to change path: cd "C:\Program Files\Oracle\VirtualBox"</p> <p>Command to clone an existing vdi file: </p> <p><em>VBoxManage clonehd "path_to_source_image.vdi" "path_to_destination_image.vdi"</em></p> <p>From version 4.1 there is an menu option to clone existing images in the VirtualBox Manager GUI.</p> <p><strong>Tip 2 – Clone existing Virtual disk to raw format</strong></p> <p>Cloning an existing image file to raw makes an copy of the image without any compression to the vdi format.</p> <p>Command to clone to raw file:</p> <p><em>VBoxManage clonehd --format RAW “path_to_source_image.vdi” “path_to_destination_image.raw”</em></p> <p><strong>Tip 3 – Convert raw image to vdi format</strong></p> <p>If you have an raw image you can convert it to the compressed vdi file format.</p> <p>Command to convert from raw to vdi:</p> <p><em>VBoxManage convertfromraw --format VDI “path_to_source_image.vdi” “path_to_destination_image.raw”</em></p> <p><strong>Tip 4 – Recompress an vdi file</strong></p> <p>After using an image file for an while it will keep allocating disk space if dynamic allocation is used, but you can reclaim some of that used disk space.</p> <p>Inside the image you need to remove unused data and use an tool like <a href="http://www.piriform.com/CCLEANER">CCleaner</a> in Windows images to clear temp files. </p> <p>Then you need to defrag the hard drive inside the image. Do defrag the hard drive twice. I use the tool <a href="http://www.piriform.com/defraggler">Defraggler</a> which is much better that the default defrag tool of Windows. </p> <p>After that you can use the <a href="http://www.piriform.com/CCLEANER">CCleaner</a> drive wipe tool to clear free space only or use an similar tool. This will replace all clear space with 0 bits. </p> <p>After that shutdown the image file and run the following command to recompress the vdi file: <em>VboxManage modifyhd “path_to_target_image.vdi” compact</em></p> <p>This command will remove all those 0 bits from the image file. After running the above command you will see that your vdi disk allocation has reduced. I have successfully shrink an vdi file from 70GB to 41GB.</p> <p><strong>Tip 5 – Host VMWare images</strong></p> <p>Firstly on you host you need to uninstall all <a href="http://www.vmware.com/">VMWare</a> tools.</p> <p>Inside VirtualBox mount the <a href="http://www.vmware.com/">VMWare</a> image (.vmdk file) as an IDE, not SATA (the default when using the VirtualBox wizard).</p> <p>Make sure the .vmdk filename does not contain '.' suffices.</p> <p>After that you should be able to run the virtual disk.</p> <p> </p> <p>Hope all these tips help you to run VirtualBox more efficiently and make you life easier. If you use any other VirtualBox command regularly let me know!</p> <p>Cheerio!</p> Anonymoushttp://www.blogger.com/profile/09015555753126554122noreply@blogger.comtag:blogger.com,1999:blog-4041544417227362720.post-20407300378592757382011-07-28T19:53:00.001-07:002011-07-28T19:53:44.027-07:00SA Dev Workshop: Web UI Testing<p>I had the pleasure of presenting at the SA Dev workshop on 27 July 2011.Thanks to everyone who attended and please continue to support the local communities.</p> <p>My discussion was based on Web application UI testing with open source tools and Visual Studio Testing tools. More specific I was covering <a href="https://github.com/acken/AutoTest.Net">AutoTest.Net</a> for C# unit testing, <a href="http://docs.jquery.com/Qunit">QUnit</a> for JavaScript testing and <a href="http://blogs.msdn.com/b/amit_chatterjee/archive/2009/01/29/web-and-load-testing-with-visual-studio-team-system.aspx">Web Tests and Load Tests</a> in Visual Studio 2010.</p> <p>Here is the links to my slides and demo application:</p> <p><a href="http://dl.dropbox.com/u/4406115/SADev/WebUI%20Testing.pptx">Web UI Testing Slides</a></p> <p><a href="http://dl.dropbox.com/u/4406115/SADev/WorldFootball.zip">World of Football Demo Application</a></p> <p>Any feedback is welcome and thanks again!</p> <p>Cheerio!</p> Anonymoushttp://www.blogger.com/profile/09015555753126554122noreply@blogger.comtag:blogger.com,1999:blog-4041544417227362720.post-54808060207918489562011-05-17T02:38:00.001-07:002011-05-17T02:38:51.567-07:00Lessons Learned using WCF net.tcp<p>I recently worked on a project where I developed an WCF web services that is exposed via https and net.tcp. The web services does all the database calls and business logic. Here are some lessons or tips for developing in WCF with net.tcp.</p> <p>When I use the net.tcp channel to communicate to the web service I often get the following error:</p> <p><em>The socket connection was aborted. This could be caused by an error processing your message or a receive timeout being exceeded by the remote host, or an underlying network resource issue. Local socket timeout was '00:01:00'.</em></p> <p>This is the default error message that you will get from WCF if something went wrong but the WCF channel does not know exactly what error occurred.</p> <p>What to do when you receive this message.</p> <ol> <li>Increase the ReceiveTimeout and SendTimeout on the binding that is used by your web service to 5 min. The other timeout properties default values are 99.9% always correct. The 5 min is very big and will usually eliminate actual timeout issues.</li> <li>The usual suspects for the error is MaxBufferSize, MaxBufferPoolSize, MaxReceivedMessageSize, MaxArrayLength default size (65536) is to small. Increase them by adding a 0 at the end (655360) to see if the error disappear. Then by small increments reduce the size to find the correct value.</li> <li>If your web service method returns an big message or generic array or list with a big items count and big object graph you have to increase the value of the property MaxItemsInObjectGraph in the dataContractSerializer element. You need to create a Service Behaviour (Service side) and Endpoint Behaviour (Client side) with the dataContractSerializer element. You will then see the MaxItemsInObjectGraph property.</li> <li>To increase your communication between service and client you can switch the <a href="http://msdn.microsoft.com/en-us/library/system.servicemodel.transfermode.aspx">TransferMode</a> in the binding from Buffered to Streamed.</li> <li>When you call the web service from an .Net client please avoid calling your code inside a using statement. Rather use try-finally where you can call close on the client object and if the communication channel faulted you can call abort on the client object.</li></ol> <p>These lessons will hopefully make your net.tcp development experience easier. If you have any further tips or lessons please leave a comment.</p> <p>Cheerio!</p> Anonymoushttp://www.blogger.com/profile/09015555753126554122noreply@blogger.comtag:blogger.com,1999:blog-4041544417227362720.post-32241387779968561002011-05-09T00:18:00.001-07:002011-05-09T00:18:16.287-07:00Devs4Devs Cape Town Talk–Using AppFabric Cache with WCF<p>Here is my talk that I presented at Devs4Devs. Thanks to Microsoft for the opportunity and thanks to the guys who attended.</p> <p>At the bottom is the links to my presentation and sample code. Before you can use the sample you need to setup Windows Server AppFabric Cache and use the AdventureWorks Database. </p> <p>Another note that the web service gets deployed to IIS when you build the project.</p> <p>Here the links:</p> <p>AdventureWorks Database</p> <p><a href="http://msftdbprodsamples.codeplex.com/">http://msftdbprodsamples.codeplex.com/</a></p> <p>Sample Application</p> <p><a title="http://dl.dropbox.com/u/4406115/Devs4Devs%202011/AdventureService.zip" href="http://dl.dropbox.com/u/4406115/Devs4Devs%202011/AdventureService.zip">http://dl.dropbox.com/u/4406115/Devs4Devs%202011/AdventureService.zip</a></p> <p>Presentation Slides</p> <p><a title="http://dl.dropbox.com/u/4406115/Devs4Devs%202011/WCF%20AppFabric%20Cache.pptx" href="http://dl.dropbox.com/u/4406115/Devs4Devs%202011/WCF%20AppFabric%20Cache.pptx">http://dl.dropbox.com/u/4406115/Devs4Devs%202011/WCF%20AppFabric%20Cache.pptx</a></p> <p>Any feedback or questions are welcomed. Until the next talk! </p> Anonymoushttp://www.blogger.com/profile/09015555753126554122noreply@blogger.comtag:blogger.com,1999:blog-4041544417227362720.post-3404651601106250702011-02-19T11:48:00.001-08:002011-02-19T11:48:14.470-08:00BizTalk 2010 SQL Adapter Disappearing Act<p>I was busy going through some SQL Adapter walkthroughs in <a class="zem_slink" title="Microsoft BizTalk Server" href="http://en.wikipedia.org/wiki/Microsoft_BizTalk_Server" rel="wikipedia">BizTalk</a> 2010 and something very strange happened. </p> <p>I was setting up my SQL Adapter, not the WCF SQL Adapter, and I come to the wizard screen where I need to select between Select or Stored procedure options.</p> <p>I happily decided on the Select option. In the next screen you get a text area to write your SQL statement. Mine was just a simple select from a small table. I click the Next button and bang the whole wizard dialog disappeared. No SQLService.xsd was generated. I was so confused and though I did something wrong. I went over the steps like a crazy man.</p> <p>Finally I restarted <a class="zem_slink" title="Microsoft Visual Studio" href="http://www.microsoft.com/visualstudio" rel="homepage">Visual Studio</a> 2010 IDE and try again. After the restart everything just worked. I still don’t know why this happens. I don’t know if it is Visual Studio IDE or the SQL Adapter Wizard issue.</p> <p><strong>Lessons Learned</strong> – If something goes wrong in Visual Studio IDE for no reason then just restart the IDE and try again!</p> <p>Cheerio!</p> <div style="margin-top: 10px; height: 15px" class="zemanta-pixie"></div> Anonymoushttp://www.blogger.com/profile/09015555753126554122noreply@blogger.comtag:blogger.com,1999:blog-4041544417227362720.post-74607800597968770822011-02-17T22:11:00.001-08:002011-02-17T22:11:10.728-08:00RedGate .Net Reflector Free Replacement Tools – ILSpy and Resharper Decompiler<p>With all the controversy about Reflector going commercial. People had to start looking for other solutions. You know that <a href="http://www.red-gate.com/" target="_blank">RedGate</a> tools are very expensive.</p> <p>So, the first tool I want to show you is <a href="http://wiki.sharpdevelop.net/ilspy.ashx" target="_blank">ILSpy</a> from <a href="http://sharpdevelop.net/" target="_blank">SharpDevelop</a>. This is a new tool and that means development is in progress. It follow Reflector’s principle of keeping it simple. Here is a screenshot:</p> <p><a href="http://lh4.ggpht.com/_ryn5WhkGsJ4/TV4NdXhk9fI/AAAAAAAAAFg/bMLDgwucWz8/s1600-h/ILSpy%5B3%5D.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="ILSpy" border="0" alt="ILSpy" src="http://lh4.ggpht.com/_ryn5WhkGsJ4/TV4Ne3Emt8I/AAAAAAAAAFk/PkQ-TISiX5I/ILSpy_thumb%5B1%5D.png?imgmax=800" width="475" height="255"></a></p> <p>ILSpy Features</p> <ul> <li>Assembly Browsing</li> <li>IL Disassembly</li> <li>Saving of resources</li> <li>Search for types/methods/properties</li> <li>Hyperlink-based type/method/property navigation</li> <li>Base/Derived types navigation</li> <li>Navigation History</li></ul> <p>ILSpy Roadmap</p> <ul> <li>Improve the decompiler</li> <li>Assembly Lists</li> <li>Find References</li> <li>Improve search performance</li> <li>Save Assembly as C# Project</li> <li>Debugger</li> <li>Bookmarks</li> <li>Extensibility via addins</li> <li>Find Usage (of type/method/property)</li></ul> <p>The only thing that is short coming is all those nice plugins that Reflector had. I believe the authors of those plug-ins will soon port them over to ILSpy. As soon as ILSpy provide the extensibility via addins. Please download the tool and provide feedback.</p> <p>On another note if you are using <a href="http://www.jetbrains.com/resharper/" target="_blank">Resharper</a>. In Resharper 6 that is currently under development you will get a decompiler. Go and check out the following article on <a href="http://www.jetbrains.com/" target="_blank">JetBrains</a> site: <a href="http://blogs.jetbrains.com/dotnet/2011/02/resharper-6-bundles-decompiler-free-standalone-tool-to-follow/" target="_blank">Resharper 6 Bundles Decompiler, Free Standalone Tool to Follow</a></p> <p>Cheerio!</p> Anonymoushttp://www.blogger.com/profile/09015555753126554122noreply@blogger.comtag:blogger.com,1999:blog-4041544417227362720.post-35528748737342608562011-02-02T22:52:00.001-08:002011-02-02T22:52:05.877-08:00The Perfect Developer Setup<p>I’m going tell you the perfect developer laptop environment setup. Does not matter if you are a Linux or Windows developer. Maybe Mac user can also find this interesting.</p> <p>I’m mainly a .Net developer. Sometimes I dabble in Node.js (So Cool!) on Ubuntu. I also use Ubuntu for using Git. My main technology focus for this year is ASP.Net MVC, <a class="zem_slink" title="Microsoft SharePoint" href="http://sharepoint.microsoft.com/en-us/Pages/default.aspx" rel="homepage">SharePoint</a> 2010 and Node.js. I sometimes use BizTalk as well.</p> <p>Firstly let’s discuss my hardware requirements. I need the following laptop spec:</p> <ul> <li><a href="http://www.intel.com/products/laptop/processors/index.htm" target="_blank">Intel Core i7 CPU</a> <li>12 GB Ram (minimum) <li>32GB <a class="zem_slink" title="Solid-state drive" href="http://en.wikipedia.org/wiki/Solid-state_drive" rel="wikipedia">SSD Drive</a> <li>17” Screen Resolution <li><a href="http://www.nvidia.co.uk/page/mobile.html" target="_blank">Nvidia Geforce 500M GPU</a> <li><a href="http://www.lacie.com/us/products/product.htm?pid=11495" target="_blank">LaCie Rugged SuperSpeed 500GB USB 3.0 External Hard Drive</a></li></ul> <p>I’m going to use this laptop to setup the minimum <a class="zem_slink" title="Ubuntu (operating system)" href="http://www.ubuntu.com/" rel="homepage">Ubuntu OS</a> with VMWare or Virtualbox on top. I’m going to create development VM images on the external hard-drive that will use that nice USB 3.0 performance.</p> <p><strong>Hardware in Detail</strong></p> <p><a href="http://en.wikipedia.org/wiki/File:Intel_Corei7_2009.svg"><img style="border-bottom: medium none; border-left: medium none; display: block; border-top: medium none; border-right: medium none" alt="Intel Core i7 logo as of 2009" src="http://upload.wikimedia.org/wikipedia/en/thumb/0/0d/Intel_Corei7_2009.svg/277px-Intel_Corei7_2009.svg.png" width="72" height="55"></a></p> <p>The Intel Core i7 CPU has great benefits such as 4 Cores with Hyper Threading. Including Intel Turbo Boost Technology and <a class="zem_slink" title="Intel GMA" href="http://en.wikipedia.org/wiki/Intel_GMA" rel="wikipedia">Intel HD Graphics</a>. This CPU will provide enough horsepower to run multiple <a class="zem_slink" title="OpenVMS" href="http://www.hp.com/go/openvms" rel="homepage">VMs</a>.</p> <p>The 12GB Ram is necessary for being able to run multiple VMs. As an example, SharePoint 2010 requires 8GB Ram to run and running Visual Studio for development can easily consume 4GB Ram.</p> <p>The 32GB SSD Drive is the main hard drive on which Ubuntu and the virtual applications are running. SSD gives you very high <a href="http://en.wikipedia.org/wiki/IOPS" target="_blank">IOPS</a>. You don’t need allot of capacity to run the minimum installation of Ubuntu.</p> <p>The 17” Screen resolution is just a personal choice that give you enough screen real estate for development.</p> <p>The Nvidia Geforce 500M GPU provide some nice features where certain graphic intense application will benefit from. The virtual applications started to support 3D acceleration inside the VMs. A side interest for me is also the ability to develop with Nvidia Cuda and OpenCL. Nvidia also provide the Optimus technology that intelligently optimize the GPU for better battery life.</p> <p><img style="border-bottom: medium none; border-left: medium none; display: block; border-top: medium none; border-right: medium none" alt="500GB plug & play" src="http://farm4.static.flickr.com/3192/3076219539_8fbef918cc_m.jpg" width="215" height="165"></p> <p>The Lacie 500GB USB 3.0 drive is where all my VMs will be saved. The drive run at 7200 rpm and can deliver a transfer rate of up to 110MB/s via the USB 3.0 interface. The 500GB size is more than enough. You can get an additional external 2TB drive to backup the VMs.</p> <p><strong>Minimum Ubuntu Installation</strong></p> <p>Firstly go and download the minimum Ubuntu installation <a href="https://help.ubuntu.com/community/Installation/MinimalCD" target="_blank">CD ISO</a>. You can install it via cd-rom or USB device. Install Ubuntu as required by following the installation guide. At the end of the installation you be given the command prompt inside Ubuntu. Make sure you are connected to the internet via a network cable. This is required to download the additional packages.</p> <p>Now we want to enable some of the fancy Ubuntu features, because we don’t want to be in the command prompt for ever. So here is what we are going to install.</p> <ul> <li>Minimal Gnome <li>Wireless Networking <li>Chrome Browser <li>Ubuntu Theme <li><a class="zem_slink" title="VirtualBox" href="http://www.virtualbox.org/" rel="homepage">VirtualBox</a> <li>VMware Player</li></ul> <p>Type the following to install the minimal gnome. This will install a graphical environment.</p> <p><em>sudo apt-get install gnome-panel gdm gnome-terminal</em></p> <p>Type the following to install Wireless Networking. This will give you a battery monitor and a icon to configure wireless networking. Additionally you get the hibernate button on the shutdown menu.</p> <p><em>sudo apt-get install network-manager network-manager-gnome gnome-power-manager hibernate</em></p> <p>Let’s install the Chrome browser. Type the following.</p> <p><em>sudo apt-get install chromium-browser flashplugin-installer</em></p> <p>The default gnome theme looks ugly. Type the following to enable the Ubuntu theme.</p> <p><em>sudo apt-get install ubuntu-artwork</em></p> <p>After that I would recommend you run the following commands.</p> <p><em>sudo apt-get update</em></p> <p><em>sudo reboot</em></p> <p>The laptop will firstly make sure it has all the updates and after that we reboot the laptop. After the reboot you will get the login dialog that you use to login to the desktop. Once you on the desktop open a terminal so that we can install Virtualbox or VMWare player. The virtualization technology that you choose is up to you. I will show both.</p> <p>Firstly I will recommend that you install the Build Essentials on Ubuntu. Some packages require that the build essentials are install before the packages can install.</p> <p><em>sudo apt-get install gcc build-essentials</em></p> <p><strong>Lets Virtualize – VirtualBox</strong></p> <p><a href="http://en.wikipedia.org/wiki/File:Virtualbox_logo.png"><img style="border-bottom: medium none; border-left: medium none; display: block; border-top: medium none; border-right: medium none" alt="VirtualBox" src="http://upload.wikimedia.org/wikipedia/en/thumb/d/d5/Virtualbox_logo.png/300px-Virtualbox_logo.png" width="170" height="121"></a></p> <p>Type the following to install <a href="http://www.virtualbox.org/" target="_blank">VirtualBox</a>. In the terminal type:</p> <p><em>sudo gedit /etc/apt/source.list</em></p> <p>Add the following VirtualBox repository</p> <p><em>deb </em><a href="http://download.virtualbox.org/virtualbox/debian"><em>http://download.virtualbox.org/virtualbox/debian</em></a><em> maverick contrib</em></p> <p>Now let’s add the public key of VirtualBox to the system.</p> <p><em>wget –q </em><a href="http://download.virtualbox.org/virtualbox/debian/oracle_vbox.asc"><em>http://download.virtualbox.org/virtualbox/debian/oracle_vbox.asc</em></a><em> –O- | sudo apt-key add -</em></p> <p>Update the package database.</p> <p><em>sudo aptitude update</em></p> <p>Now to install VirtualBox type the following magic command.</p> <p><em>sudo apt-get install virtualbox-4.0</em></p> <p>After VirtualBox has installed you might want to install the dkms package.</p> <p><em>sudo apt-get install dkms</em></p> <p><strong>Lets Virtualize – VMware Player</strong></p> <p><a href="http://www.crunchbase.com/company/vmware"><img style="border-bottom: medium none; border-left: medium none; display: block; border-top: medium none; border-right: medium none" alt="Image representing VMware as depicted in Crunc..." src="http://www.crunchbase.com/assets/images/resized/0001/9593/19593v2-max-450x450.png" width="122" height="44"></a>Lets start installing <a href="http://www.vmware.com/products/player/" target="_blank">VMWare Player</a>. Go to the VMware player download page and download the binaries. Now we need to give the VMWare bundle executable privileges. Type the following in terminal where the VMware bundle exist.</p> <p><em>chmod +x VMware-Player*.bundle</em></p> <p><em>gksudo bash ./VMware-Player*.bundle</em></p> <p>After these commands a installer window will pop up. Just follow the wizard guide. This was now quick and easy.</p> <p><strong>Installation Summary</strong></p> <p>At this stage all the required software is installed for you to get started with creating VMs. Here is a list of some additional software you might want to install on Ubuntu. </p> <ul> <li>7-zip <li>Blowfish <li>VLC-Player</li></ul> <p>Just remember that you want to keep your Host OS as small as possible and to use as little possible memory. I would recommend that you format the external drive to ext 4 file system. It provides very nice performance for the VMs.</p> <p>I hope you see the benefits of using VMs for your development environments. With this setup you can go crazy with creating VMs and you can easily backup your VMs en data. If you have any suggestions to improve this setup, please let me know.</p> <p>Cheerio! </p> <div style="margin-top: 10px; height: 15px" class="zemanta-pixie"><a class="zemanta-pixie-a" title="Enhanced by Zemanta" href="http://www.zemanta.com/"><img style="border-bottom-style: none; border-left-style: none; border-top-style: none; float: right; border-right-style: none" class="zemanta-pixie-img" alt="Enhanced by Zemanta" src="http://img.zemanta.com/zemified_e.png?x-id=609d4150-5e14-4fb4-9752-8e88086b9ff5"></a></div> Anonymoushttp://www.blogger.com/profile/09015555753126554122noreply@blogger.comtag:blogger.com,1999:blog-4041544417227362720.post-32963554368766232132011-01-07T07:14:00.001-08:002013-03-17T04:10:04.870-07:00Authentication using JSON from ASP .Net MVC 3.0 to WCFToday I want to show you how to develop an authentication system with JSON using ASP .Net MVC 3.0 and WCF. <br />
Firstly I want to discuss the system design. I’m using <a href="http://www.asp.net/mvc/mvc3" target="_blank">Asp .Net MVC 3.0</a> framework to publish Html views to the client browser and for defining pretty URLs in the project. There is no business logic in the MVC framework. I define all my business rules in an WCF Service that only respond to <a href="http://www.json.org/" target="_blank">JSON</a> requests. I’m using JQuery from my Html pages to query the web services for my business data. <br />
<a href="http://lh3.ggpht.com/_ryn5WhkGsJ4/TSctsO4fmVI/AAAAAAAAAE0/ZskvSNTyKDM/s1600-h/Asp-MVC-WCF-Json-Design4.jpg"><img alt="Asp MVC WCF Json Design" border="0" height="262" src="http://lh6.ggpht.com/_ryn5WhkGsJ4/TScttvAItXI/AAAAAAAAAE4/70pveY8KgHw/Asp-MVC-WCF-Json-Design_thumb2.jpg?imgmax=800" style="background-image: none; border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="Asp MVC WCF Json Design" width="495" /></a><br />
You might ask yourself why I would decide on this design? <br />
Benefits:<br />
<ul>
<li>Clear separation of concern. </li>
<li>Smaller request and response data transfers. </li>
<li>Very Scalable System ( Quickly move web services to <a href="http://www.microsoft.com/windowsazure/" target="_blank">Windows Azure</a> ). </li>
<li>Dynamic Html Views Design.</li>
</ul>
Negatives:<br />
<ul>
<li><a href="http://www.json.org/" target="_blank">JSON</a> data is plain text. </li>
<li>Require SSL for secure and encrypted data transfer.</li>
</ul>
I hope you understand the benefits and negatives. There are more benefits and negatives that can be added. <strong>SSL is very important</strong> to be enabled when using this approach for authentication. Otherwise the user’s password will be available when transferred to the server.<br />
<u><strong>Authentication Code Example:</strong></u><br />
Download the code to follow: <a href="http://sdrv.ms/ZK3e7o" target="_blank">JQueryLogin.zip</a><br />
I created the default <a href="http://www.asp.net/mvc/mvc3" target="_blank">Asp .Net MVC 3.0</a> project with unit test project included. For this blog I did not do any unit testing. A nice challenge for you! In the solution there are three projects. JqueryLogin project, is the MVC web project. JqueryLogin.WebService project, is the WCF service that will handle JSON requests and business logic. JqueryLogin.Contracts project, is the WCF contracts that is defined for each request and response.<br />
In the MVC web project I use the Razor View Engine. I also clean-up the code to just provide Views with no logic in the controllers. Especially go and look at the AccountController. I did not touch any views that is created by the template. Also I added the necessary JavaScript files that is required to do Ajax requests and create dynamic Html views.<br />
In the _Layout.cshtml I added a bit of special JavaScript resolve function to help resolve URLs in my other JavaScript files. I got the original code from another blog <em>(Forgot where?)</em> but fixed it for MVC 3.0.<br />
<pre class="brush: js;"><script type="text/javascript">
Url = function () { }
Url.prototype =
{
_relativeRoot: "@Url.Content("~/")",
resolve: function (relative) {
var resolved = relative;
if (relative.charAt(0) == '~') resolved = this._relativeRoot + relative.substring(2);
return resolved;
}
}
$Url = new Url();
</script></pre>
<br />
With this function I will be able to resolve URLs like this in JavaScript:<br />
<pre class="brush: js;">window.location.href = $Url.resolve("~/Home/Index");</pre>
<br />
Now lets look at the other JavaScript files. The file ajax.js has some infrastructure and setup code that will help me with the requests to the web service. The User.js file is where the main logic is to register, sign-in and sign-out users to the web application. <br />
<br />
At the top of the file I define two object Register and SignIn with properties that match the same properties as the RegisterRequest Contract and SignInRequest Contract. The code that follow is where I define where the web service is that needs to be called. The web service methods are called after the Html form pass validation on the submit. Here is the code for sign-in and sign-out of the user:<br />
<pre class="brush: js;">/// <reference path="jquery-1.4.1.js" />
/// <reference path="jquery.validate.min.js" />
/// <reference path="ajax.js" />
var SignIn = {
UserName : '',
Password : '',
RememberMe: ''
};
var UserServiceURL = "../WebService/UserService.svc/";
var UserServiceProxy = new serviceProxy(UserServiceURL);
$(document).ready(function () {
$("#loginForm").validate({ submitHandler: function (form) {
SignInUser();
}
});
$('a[href="/Account/LogOff"]').click(function () {
SignOutUser();
return false;
});
});
function SignInUser() {
blockDisplay();
var request = BuildSignInRequest();
UserServiceProxy.invoke({
serviceMethod: "SignIn",
data: { request: request },
callback: function (response) {
$('#status').empty().html("<strong>Success: " + response.Message + "</strong>");
$.unblockUI();
window.location.href = $Url.resolve("~/Home/Index");
},
error: function (xhr, errorMsg, thrown) {
OnPageError(xhr, errorMsg, thrown);
$.unblockUI();
}
});
return false;
}
function SignOutUser() {
blockDisplay();
UserServiceProxy.invoke({
serviceMethod: "SignOut",
data: null,
callback: function (response) {
$('#status').empty().html("<strong>Success: " + response.Message + "</strong>");
$.unblockUI();
window.location.href = $Url.resolve("~/Home/Index");
},
error: function (xhr, errorMsg, thrown) {
OnPageError(xhr, errorMsg, thrown);
$.unblockUI();
}
});
return false;
}
function BuildSignInRequest() {
SignIn.UserName = $('input[name="UserName"]').val();
SignIn.Password = $('input[name="Password"]').val();
SignIn.RememberMe = $('input[name="RememberMe"]').val();
if (SignIn.RememberMe === "on") {
SignIn.RememberMe = true;
}
else {
SignIn.RememberMe = false;
}
return SignIn;
}</pre>
<br />
<strong><u>WCF Web Service Setup</u></strong><br />
<br />
Now let look at the web service to get all of this working. Firstly you define you web service in an interface file like IUserService.cs. In the UserService.svc mark up you have to change the factory to be able to handle JSON requests and responses.<br />
<pre class="brush: csharp;"><%@ ServiceHost Language="C#" Service="JqueryLogin.WebService.Service.UserService" Factory="System.ServiceModel.Activation.WebScriptServiceHostFactory" %></pre>
<br />
In the UserService implementation you have to set AspNetCompatibilityRequirements attribute. This will allow for cookies to be set for when the user is authenticated.<br />
<pre class="brush: csharp;">[ServiceBehavior(IncludeExceptionDetailInFaults = true)]
[AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Required)]
public class UserService : IUserService
{
// Implementation Code
}</pre>
<br />
The implementation of the user authentication can be found in the AccountMembershipManager class and the FormsAuthenticationManager class. The last part that is required for the service is the service binding. For this service I use wsHttpBinding.<br />
<pre class="brush: csharp;"><services>
<service behaviorConfiguration="DefaultBehavior" name="UserService">
<endpoint binding="wsHttpBinding" contract="JqueryLogin.WebService.IUserService" />
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
</service>
</services></pre>
<br />
<strong><u>Show Some Results</u></strong><br />
<br />
I use <a href="http://www.google.com/chrome" target="_blank">Chrome Browser</a> for debugging. I will show you the traced request and response output for Sign-in and Sign-out of user. I underline in red in the images the important details to notice.<br />
<br />
SignIn Request – <em>Click to Enlarge</em><br />
<br />
<a href="http://lh6.ggpht.com/_ryn5WhkGsJ4/TSctwJvKS3I/AAAAAAAAAE8/F8FrlysTGD4/s1600-h/SignInRequest%5B7%5D.jpg"><img alt="SignInRequest" border="0" height="144" src="http://lh5.ggpht.com/_ryn5WhkGsJ4/TSctxDjpBII/AAAAAAAAAFA/lr2eKR3BoVs/SignInRequest_thumb%5B5%5D.jpg?imgmax=800" style="background-image: none; border-bottom: 0px; border-left: 0px; border-right: 0px; border-top: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="SignInRequest" width="247" /></a><br />
<br />
SignIn Response – <em>Click to Enlarge</em><br />
<br />
<a href="http://lh6.ggpht.com/_ryn5WhkGsJ4/TScty_YTytI/AAAAAAAAAFE/sWP2zd6NuTM/s1600-h/SignInResponseContent%5B2%5D.jpg"><img alt="SignInResponseContent" border="0" height="154" src="http://lh5.ggpht.com/_ryn5WhkGsJ4/TSctz_seGHI/AAAAAAAAAFI/qEpWn0zQr9I/SignInResponseContent_thumb.jpg?imgmax=800" style="background-image: none; border-bottom: 0px; border-left: 0px; border-right: 0px; border-top: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="SignInResponseContent" width="244" /></a><br />
<br />
<br />
SignOut Request – <em>Click to Enlarge</em><br />
<br />
<a href="http://lh3.ggpht.com/_ryn5WhkGsJ4/TSct2W8iXyI/AAAAAAAAAFM/kLnJVkDhFG0/s1600-h/SignOutRequest%5B2%5D.jpg"><img alt="SignOutRequest" border="0" height="154" src="http://lh3.ggpht.com/_ryn5WhkGsJ4/TSct3Vy6ZgI/AAAAAAAAAFQ/IdA-GFb9OHI/SignOutRequest_thumb.jpg?imgmax=800" style="background-image: none; border-bottom: 0px; border-left: 0px; border-right: 0px; border-top: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="SignOutRequest" width="244" /></a><br />
<br />
SignOut Response – <em>Click to Enlarge</em><br />
<br />
<a href="http://lh4.ggpht.com/_ryn5WhkGsJ4/TSct5VSDBtI/AAAAAAAAAFU/rV751tnuzyk/s1600-h/SignOutResponseContent%5B2%5D.jpg"><img alt="SignOutResponseContent" border="0" height="154" src="http://lh4.ggpht.com/_ryn5WhkGsJ4/TSct6ibasGI/AAAAAAAAAFY/NnzqhXJkM40/SignOutResponseContent_thumb.jpg?imgmax=800" style="background-image: none; border-bottom: 0px; border-left: 0px; border-right: 0px; border-top: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="SignOutResponseContent" width="244" /></a><br />
<br />
<strong><u>Summary</u></strong><br />
<br />
The original idea of using JSON and WCF for creating a responsive website came when I read Chris Love blog entries <a href="http://professionalaspnet.com/archive/2010/02/01/Creating-a-WCF-Service-for-JSON.aspx" target="_blank">“Creating a WCF Service for JSON”</a> and <a href="http://professionalaspnet.com/archive/2010/01/31/WCF-and-JQuery-Using-JSON.aspx" target="_blank">“WCF and JQuery Using JSON”</a>. The original JavaScript infrastructure come from him. As you can see that JSON allow for speedy web development and responsive web pages. <a href="http://jquery.com/" target="_blank">JQuery</a> just make it so easy to create Ajax calls. <br />
<br />
Hope you enjoy this entry and any feedback or questions are welcome.<br />
<br />
Cheerio!Anonymoushttp://www.blogger.com/profile/09015555753126554122noreply@blogger.comtag:blogger.com,1999:blog-4041544417227362720.post-67183416238365974042010-10-13T07:58:00.001-07:002010-10-13T07:58:03.615-07:00Upload Documents to SharePoint 2010 with Web Services<p>Today I’m going to show you how to upload documents to a document library in SharePoint 2010 and also to create folders via web services in the document library.</p> <p>I configured a document library where I want to create folders and store documents. I named it “My Documents Library” located at “http://server/sites/personal/My Documents Library”</p> <p><strong>Let’s Create Folders</strong></p> <p>In your .Net project you have to add a service reference to <a title="http://cdt-laptop/_vti_bin/Dws.asmx" href="http://server/sites/personal/_vti_bin/Dws.asmx">http://server/sites/personal/_vti_bin/Dws.asmx</a>. This is the Document Workspace service.</p> <p>Here is the code to create a folder in the document library:</p><pre style="border-bottom: #cecece 1px solid; border-left: #cecece 1px solid; padding-bottom: 5px; background-color: #fbfbfb; min-height: 40px; padding-left: 5px; width: 650px; padding-right: 5px; overflow: auto; border-top: #cecece 1px solid; border-right: #cecece 1px solid; padding-top: 5px"><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 1: <span style="color: #008000">// Title of Document Library</span><br /></pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 2: <span style="color: #0000ff">string</span> library = "<span style="color: #8b0000">My Documents Library</span>";<br /></pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 3: <br /></pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 4: DwsSoapClient client = <span style="color: #0000ff">new</span> DwsSoapClient();<br /></pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 5: <span style="color: #0000ff">if</span> (client.ClientCredentials != <span style="color: #0000ff">null</span>)<br /></pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 6: {<br /></pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 7: client.ClientCredentials.Windows.AllowedImpersonationLevel = TokenImpersonationLevel.Impersonation;<br /></pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 8: }<br /></pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 9: <br /></pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 10: <span style="color: #0000ff">try</span><br /></pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 11: {<br /></pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 12: <span style="color: #008000">// Create First Folder</span><br /></pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 13: <span style="color: #0000ff">string</span> createResult = client.CreateFolder(library + "<span style="color: #8b0000">/Folder One</span>");<br /></pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 14: Trace.WriteLine("<span style="color: #8b0000">Create Folder Result: </span>" + createResult);<br /></pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 15: <br /></pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 16: <span style="color: #008000">// Create subfolder</span><br /></pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 17: createResult = client.CreateFolder(library + "<span style="color: #8b0000">/Folder One/Folder Two</span>");<br /></pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 18: Trace.WriteLine("<span style="color: #8b0000">Create Folder Result: </span>" + createResult);<br /></pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 19: }<br /></pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 20: <span style="color: #0000ff">finally</span><br /></pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 21: {<br /></pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 22: <span style="color: #0000ff">if</span> (client.State == CommunicationState.Faulted)<br /></pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 23: {<br /></pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 24: client.Abort();<br /></pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 25: }<br /></pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 26: <br /></pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 27: <span style="color: #0000ff">if</span> (client.State != CommunicationState.Closed)<br /></pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 28: {<br /></pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 29: client.Close();<br /></pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 30: }<br /></pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 31: }</pre></pre><br /><p>The first thing to watch out for is setting the client credentials on the client proxy. This tells the client to impersonate you to create the folders. You the client need to have the rights to create folders in the document library.</p><br /><p>To create folders is very straight forward where you use the CreateFolder method. As you can see you specify the library title and forward slash with the new folder to create. I also show in the code to create subfolders.</p><br /><p><strong>Let’s Upload a Document</strong></p><br /><p>To upload a document we need to add another service reference to <a title="http://cdt-laptop/_vti_bin/copy.asmx" href="http://server/sites/personal/_vti_bin/copy.asmx">http://server/sites/personal/_vti_bin/copy.asmx</a>. This is the Copy service.</p><br /><p>Here is the code to upload a document to the document library:</p><pre style="border-bottom: #cecece 1px solid; border-left: #cecece 1px solid; padding-bottom: 5px; background-color: #fbfbfb; min-height: 40px; padding-left: 5px; width: 650px; padding-right: 5px; overflow: auto; border-top: #cecece 1px solid; border-right: #cecece 1px solid; padding-top: 5px"><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 1: CopySoapClient client = <span style="color: #0000ff">new</span> CopySoapClient();<br /></pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 2: <br /></pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 3: <span style="color: #0000ff">if</span> (client.ClientCredentials != <span style="color: #0000ff">null</span>)<br /></pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 4: {<br /></pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 5: client.ClientCredentials.Windows.AllowedImpersonationLevel = TokenImpersonationLevel.Impersonation;<br /></pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 6: }<br /></pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 7: <br /></pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 8: <span style="color: #0000ff">try</span><br /></pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 9: {<br /></pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 10: client.Open();<br /></pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 11: <span style="color: #0000ff">string</span> url = "<span style="color: #8b0000">http://server/sites/personal/My Documents Library/Folder One/Folder Two/</span>";<br /></pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 12: <span style="color: #0000ff">string</span> fileName = "<span style="color: #8b0000">test.txt</span>";<br /></pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 13: <span style="color: #0000ff">string</span>[] destinationUrl = { url + fileName };<br /></pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 14: <span style="color: #0000ff">byte</span>[] content = <span style="color: #0000ff">new</span> <span style="color: #0000ff">byte</span>[] { 1, 2, 3, 4 };<br /></pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 15: <br /></pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 16: <span style="color: #008000">// Description Information Field</span><br /></pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 17: FieldInformation descInfo = <span style="color: #0000ff">new</span> FieldInformation<br /></pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 18: {<br /></pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 19: DisplayName = "<span style="color: #8b0000">Description</span>",<br /></pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 20: Type = FieldType.Text,<br /></pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 21: Value = "<span style="color: #8b0000">Test file for upload</span>"<br /></pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 22: };<br /></pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 23: <br /></pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 24: FieldInformation[] fileInfoArray = { descInfo };<br /></pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 25: <br /></pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 26: CopyResult[] arrayOfResults;<br /></pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 27: <br /></pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 28: <span style="color: #0000ff">uint</span> result = client.CopyIntoItems(fileName, destinationUrl, fileInfoArray, content, <span style="color: #0000ff">out</span> arrayOfResults);<br /></pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 29: Trace.WriteLine("<span style="color: #8b0000">Upload Result: </span>" + result);<br /></pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 30: <br /></pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 31: <span style="color: #008000">// Check for Errors</span><br /></pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 32: <span style="color: #0000ff">foreach</span> (CopyResult copyResult <span style="color: #0000ff">in</span> arrayOfResults)<br /></pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 33: {<br /></pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 34: <span style="color: #0000ff">string</span> msg = "<span style="color: #8b0000">====================================</span>" +<br /></pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 35: "<span style="color: #8b0000">SharePoint Error:</span>" +<br /></pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 36: "<span style="color: #8b0000">\nUrl: </span>" + copyResult.DestinationUrl +<br /></pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 37: "<span style="color: #8b0000">\nError Code: </span>" + copyResult.ErrorCode +<br /></pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 38: "<span style="color: #8b0000">\nMessage: </span>" + copyResult.ErrorMessage +<br /></pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 39: "<span style="color: #8b0000">====================================</span>";<br /></pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 40: <br /></pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 41: Trace.WriteLine(msg);<br /></pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 42: _logFactory.ErrorMsg(msg);<br /></pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 43: }<br /></pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 44: }<br /></pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 45: <span style="color: #0000ff">finally</span><br /></pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 46: {<br /></pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 47: <span style="color: #0000ff">if</span> (client.State == CommunicationState.Faulted)<br /></pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 48: {<br /></pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 49: client.Abort();<br /></pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 50: }<br /></pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 51: <br /></pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 52: <span style="color: #0000ff">if</span> (client.State != CommunicationState.Closed)<br /></pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 53: {<br /></pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 54: client.Close();<br /></pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 55: }<br /></pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 56: }</pre></pre><br /><p>Again I set the client credentials to be able to upload documents to the document library. I have to specify the full URL and folder structure on where I want to upload the document too. I also have to append the filename onto the URL to upload the document. </p><br /><p>I create a byte[] to simulate document content that will be saved in the document library. The web method that we use to upload a document only accepts an byte[] for content. If you use streams for reading a local file to upload, then you have to convert it to a byte[].</p><br /><p>We use the CopyIntoItem method to upload the file. Firstly have to define the filename, the destination URL, file information array and a array for results that is returned.</p><br /><p>In the example code I use the fileInfoArray to add document meta data. In the example I just add Description meta data.</p><br /><p>When you upload the file the method returns an array of results that you can check if any errors occurred on the server for the document upload.</p><br /><p>Hope this helps you and any feedback is welcome!</p><br /><p>Cheerio!</p> Anonymoushttp://www.blogger.com/profile/09015555753126554122noreply@blogger.comtag:blogger.com,1999:blog-4041544417227362720.post-8747349043061182422010-10-13T01:53:00.001-07:002010-10-13T01:53:55.317-07:00Setup SharePoint 2010 on Windows 7<p>This blog entry will show you how to setup SharePoint 2010 on Windows 7. Unfortunately it is not just as simple as to download SharePoint 2010 and say install. You can use <a href="http://www.microsoft.com/downloads/en/details.aspx?FamilyID=49c79a8a-4612-4e7d-a0b4-3bb429b46595&displaylang=en" target="_blank">SharePoint 2010 Foundation</a>, <a href="http://sharepoint.microsoft.com/en-us/buy/Pages/Editions-Comparison.aspx" target="_blank">Full SharePoint 2010 editions</a> and <a href="http://www.microsoft.com/downloads/en/details.aspx?FamilyID=CEA31A4F-A8B4-4864-B520-BE612BECDCFA" target="_blank">Search Server 2010 Express</a> for the rest of this blog entry.</p> <p><strong><u>Step 1:</u></strong></p> <p>Download your desired SharePoint 2010 edition. For the rest of this blog I will use SharePoint 2010 Foundation.</p> <p><strong><u>Step 2:</u></strong></p> <p>If you try to run the SharePointFoundation.exe and select Install SharePoint Foundation you will get the following error:</p> <p><a href="http://lh4.ggpht.com/_ryn5WhkGsJ4/TLVzSulUPdI/AAAAAAAAACk/u4EklGdB1ys/s1600-h/Setup_Error4.png"><img style="background-image: none; border-right-width: 0px; margin: ; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="Setup_Error" border="0" alt="Setup_Error" src="http://lh4.ggpht.com/_ryn5WhkGsJ4/TLVzT9SLeQI/AAAAAAAAACo/J4KOtOlgwbU/Setup_Error_thumb2.png?imgmax=800" width="415" height="157"></a></p> <p>You need to enable Windows 7 support. Before doing that we have to extract the SharePoint 2010 setup file to a directory. Go to command prompt and type the following: </p> <p><a href="http://lh5.ggpht.com/_ryn5WhkGsJ4/TLVzVOKfO1I/AAAAAAAAACs/UB3ovezUtHo/s1600-h/Extract_Command5.png"><img style="background-image: none; border-right-width: 0px; margin: ; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="Extract_Command" border="0" alt="Extract_Command" src="http://lh4.ggpht.com/_ryn5WhkGsJ4/TLVzWPf2QzI/AAAAAAAAACw/_hCFBOtSONg/Extract_Command_thumb3.png?imgmax=800" width="525" height="142"></a></p> <p><strong><u>Step 3:</u></strong></p> <p>To enable Win 7 support you have to go to C:\SharePointFiles\Files\Setup folder and open config.xml in a text editor. In the file you have to add this line <Setting Id="AllowWindowsClientInstall" Value="True" />. Your file should look like this:</p> <p><a href="http://lh5.ggpht.com/_ryn5WhkGsJ4/TLVzXMC3roI/AAAAAAAAAC0/30Nx70gY_Zc/s1600-h/Enable%20_Win7_Config%5B3%5D.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: ; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="Enable _Win7_Config" border="0" alt="Enable _Win7_Config" src="http://lh6.ggpht.com/_ryn5WhkGsJ4/TLVzYPXYC7I/AAAAAAAAAC4/ond5GcTKqMI/Enable%20_Win7_Config_thumb%5B1%5D.png?imgmax=800" width="599" height="185"></a></p> <p><strong><u>Step 4:</u></strong></p> <p>Before we run the setup you need to enable IIS on Windows 7. Go to Control Panel->Program and Features->Turn Windows features on or off.</p> <p><a href="http://lh5.ggpht.com/_ryn5WhkGsJ4/TLVzZLYzIWI/AAAAAAAAAC8/txhvypL_X7A/s1600-h/Enable_IIS%5B3%5D.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: ; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="Enable_IIS" border="0" alt="Enable_IIS" src="http://lh6.ggpht.com/_ryn5WhkGsJ4/TLVzar4OoiI/AAAAAAAAADA/anEBEMteaUg/Enable_IIS_thumb%5B1%5D.png?imgmax=800" width="340" height="304"></a></p> <p>The most important features that should be enabled is the Internet Information Services and Microsoft .NET Framework 3.5.1.</p> <p>A quick solution is to run the following in command prompt: <em>( Take out the line-breaks for command prompt )</em></p><pre>start /w pkgmgr /iu:IIS-WebServerRole;IIS-WebServer;IIS-CommonHttpFeatures;<br />IIS-StaticContent;IIS-DefaultDocument;IIS-DirectoryBrowsing;IIS-HttpErrors;<br />IIS-ApplicationDevelopment;IIS-ASPNET;IIS-NetFxExtensibility;<br />IIS-ISAPIExtensions;IIS-ISAPIFilter;IIS-HealthAndDiagnostics;<br />IIS-HttpLogging;IIS-LoggingLibraries;IIS-RequestMonitor;IIS-HttpTracing;IIS-CustomLogging;IIS-ManagementScriptingTools;<br />IIS-Security;IIS-BasicAuthentication;IIS-WindowsAuthentication;IIS-DigestAuthentication;<br />IIS-RequestFiltering;IIS-Performance;IIS-HttpCompressionStatic;IIS-HttpCompressionDynamic;<br />IIS-WebServerManagementTools;IIS-ManagementConsole;IIS-IIS6ManagementCompatibility;<br />IIS-Metabase;IIS-WMICompatibility;WAS-WindowsActivationService;WAS-ProcessModel;<br />WAS-NetFxEnvironment;WAS-ConfigurationAPI;WCF-HTTP-Activation;<br />WCF-NonHTTP-Activation<br /></pre><br /><p><strong><u>Step 5: </u></strong></p><br /><p>After IIS is installed we need to install some additional prerequisite packages that is required by SharePoint 2010. Under c:\SharePointFiles run PrerequisiteInstaller.exe.</p><br /><p>Required Prerequisite Packages:</p><br /><ul><br /><li><a href="http://go.microsoft.com/fwlink/?LinkID=141237">Microsoft Sync Framework</a></li><br /><li><a href="http://go.microsoft.com/fwlink/?LinkId=123718">SQL Server Native Client</a></li><br /><li><a href="http://support.microsoft.com/kb/974405">Windows Identity Foundation (Windows6.1-KB974405-x64.msu)</a></li><br /><li><a href="http://go.microsoft.com/fwlink/?LinkID=122517">Chart Controls</a> (not required for SharePoint Foundation 2010)</li><br /><li><a href="http://download.microsoft.com/download/A/D/0/AD021EF1-9CBC-4D11-AB51-6A65019D4706/SQLSERVER2008_ASADOMD10.msi">SQL Server Analysis Services - ADOMD.Net</a> (not required for SharePoint Foundation 2010)</li></ul><br /><p><strong><u>Step 6:</u></strong></p><br /><p>After the prerequisite packages are installed, it is recommended to run Windows Update to install the latest patches from Microsoft.</p><br /><p><strong><u>Step 7:</u></strong></p><br /><p>Ok, now you are ready to install SharePoint 2010. Under c:\SharePointFiles run setup.exe and select the option that suite you the best. Most of the time it should be the Standalone option that will install a stand-alone SharePoint 2010 installation with SQL Server Express.</p><br /><p><a href="http://lh5.ggpht.com/_ryn5WhkGsJ4/TLVzc7soseI/AAAAAAAAADE/pvu75ixuJRw/s1600-h/SharePoint_Install_Options%5B3%5D.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: ; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="SharePoint_Install_Options" border="0" alt="SharePoint_Install_Options" src="http://lh5.ggpht.com/_ryn5WhkGsJ4/TLVzfU_CEvI/AAAAAAAAADI/9DhX-prHKgU/SharePoint_Install_Options_thumb%5B1%5D.png?imgmax=800" width="431" height="363"></a></p><br /><p><em>Note: After installing SharePoint 2010 check for the latest patched from Windows Updates.</em></p><br /><p><strong><u>Step 8:</u></strong></p><br /><p>After successful installation, you are ready to use SharePoint 2010 on Windows 7. Here is the default site that is created with sample data:</p><br /><p><a href="http://lh6.ggpht.com/_ryn5WhkGsJ4/TLVzirkOibI/AAAAAAAAADM/l47U1nDqoDY/s1600-h/Default_Site4.png"><img style="background-image: none; border-right-width: 0px; margin: ; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="Default_Site" border="0" alt="Default_Site" src="http://lh5.ggpht.com/_ryn5WhkGsJ4/TLVzkLgHJFI/AAAAAAAAADQ/rjRVRNKDYbY/Default_Site_thumb2.png?imgmax=800" width="581" height="391"></a></p><br /><p>The default is accessible via the URL <a href="http://machine-name/">http://machine-name/</a>. SharePoint takes over the default port 80 on IIS.</p><br /><p>Another page that is available is the SharePoint 2010 Central Administration. Accessible via URL <a href="http://machine-name:34078/">http://machine-name:34078/</a> Just check in IIS on which port it runs. Otherwise you can all so go to the Start menu->All Programs –> Microsoft SharePoint 2010 Products –> SharePoint 2010 Central Administration.</p><br /><p><a href="http://lh3.ggpht.com/_ryn5WhkGsJ4/TLVzmwUCfDI/AAAAAAAAADU/uNZ6f_7PMms/s1600-h/Central_Admin3.png"><img style="background-image: none; border-right-width: 0px; margin: ; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="Central_Admin" border="0" alt="Central_Admin" src="http://lh6.ggpht.com/_ryn5WhkGsJ4/TLVzoelPWAI/AAAAAAAAADY/rA-9tf4P2CQ/Central_Admin_thumb1.png?imgmax=800" width="628" height="415"></a></p><br /><p>For Development you have to follow these additional steps.</p><br /><p><strong><u>Step 9:</u></strong></p><br /><p>Install the <a href="http://www.microsoft.com/downloads/en/details.aspx?FamilyID=f0c9daf3-4c54-45ed-9bde-7b4d83a8f26f&displaylang=en" target="_blank">SharePoint 2010 SDK</a>. I’m going on the assumption that Visual Studio 2010 is already installed on Windows 7 machine. The SDK provide conceptual overviews, programming tasks, code samples for SharePoint 2010.</p><br /><p><strong><u>Step 10:</u></strong></p><br /><p>Install <a href="http://msdn.microsoft.com/en-us/library/ff770300.aspx" target="_blank">SharePoint 2010 Guidance</a>. This guidance provides a deep technical insight into the key concepts and issues for SharePoint 2010 solution developers.</p><br /><p>Helpful Additional Tools for Development:</p><br /><ul><br /><li><a href="http://spm.codeplex.com/" target="_blank">SharePoint Manager 2010</a></li></ul><br /><p>With these steps completed you are ready to start developing with SharePoint 2010.</p><br /><p>Enjoy SharePoint 2010.</p><br /><p>Cheerio!</p> Anonymoushttp://www.blogger.com/profile/09015555753126554122noreply@blogger.com