SharePoint 2010 : SPMetal with a UI

LINQ to SharePoint is one the most awaited feature that is added in SharePoint 2010 . Before you can start writing LINQ queries  you need to use a command line tool called SPMETAL” that generats the entity classes. There are number of parameters that can be used while running this query , but some of most common one are web , namepsace and code”. By the way if you are working exclusively with Visual Studio 2010 , and want to get entities source code generated from inside Visual Studio 2010  , you may want to use a extension developed by a fellow MVP Waldek, you can read  and download it from here

To get started , I created a  simplest Window Form application that will generate the code file using SPMETAL and will open the file in notepad , so code can be copied. I will come back to the ideal scenario later but first lets go though and use this simple UI (called SPMETALEntityGen).  At this moment it is bit of quick and dirty way of doing it , I will try to perform some optimizations in the future.

1. In  “Path” field  change the drive letter to the one where  SharePoint is installed . Chances are “C:” will be the drive where it is installed.


2. Fill “SiteUrl”,  “namespace” and “code” fields.In the code field you can use both the full path  like “c:mycodefile.cs” or simply “”mycodefile.cs” , in the second case file will be created inside where “SPMETAL” tool is located , which is default to “BIN” folder inside the SharePoint  “14” hive , or simply put it will be right inside “Path” the path field.


3. Click on the “Run” button . You will be shown a dialog which will give you option to open the code file. If you select “Yes” , it will open the file in “notepad”. Also note that in case the file was already exist , you can also select to either go ahead and override the existing file or don’t continue with code file generation. Both of these dialogs are shown below.




You can download the tool along with source code from here.


SharePoint Server 2010 in a Server Farm : Allocation Of Physical Resources

SharePoint Server 2010 in a server farm can be bit tricky to deploy . Off course some of issues are typical to beta products , but there are other factors that require some good planning. One of these factors is allocation of Physical resources in order to get the optimize performance out of SharePoint. Let me share my experience on what configuration works fine for me. 

As I was doing all the work on Laptop  and using Hyper-V , its important to realize that the first limiting factor will be available RAM , then come processing power (mainly number of processor’s and their speed ) and  finally the Hard Disk (Speed + type). You cannot expect much from a laptop , but I end up with decent specification, which I think are good enough . I will suggest one thing , try to have multiple Network Cards  , not a absolute must but it helps in some advanced scenarios. Anyways following  is the basic configuration.

  • RAM: 12 GB
  • Hard Disk : 500 GB (7200 RPM)
  • Processor : Intel Core 2 Duo T9600  @ 2.8Ghz

Now  this is how I initially (well I will tell you why I need to change it) configure it for SharePoint 2010 on Hyper-V. As the Host OS is Win 2008 Server R2 , it will not be happy if you give it less that 2GB of RAM , and with this you are not suppose to do any thing on Host OS other than running VMs , I recommend 3 GB  which seems much better.

  • Domain Controller (DC)  :  2 GB
  • SQL Server  (DB Server) : 2 GB
  • SharePoint WFE : 4 GB
  • *Windows 7 Client  : 1 GB ( Not require for Server Farm ,  but good to have when work with SharePoint Designer 2010 + Office 2010 + SharePoint Workspace …. )

For Installing SharePoint Server 2010  you will need AD (technically you can use other types but unless you want to test that area , don’t bother) , What I did is , I put a dedicated VM for a DC, I gave it generous 2 GB in the start but during installation of SharePoint I hit error (not remember that exact one but I do remember I found solution at Jie Lie blog  , within a readers comments , and fix was to give the SQL box enough RAM , and by enough means >3GB ) soI change the configuration as follows

  • Domain Controller (DC)  :  1 GB
  • SQL Server  (DB Server) : 3 GB

After this , the SharePoint Server 2010 installation went smooth.  Following is screen shot showing all the VM’s running .


I also planned and used , Internal Network option for Hyper-V VMs , so that all the machines uses it , they are all on same domain with dedicated IP’s. One glitch is that I don’t have internet available for this network. This poses a challenge  while installing SharePoint 2010 , as it will require you to install pre-requisites from internet. The work around is to download all the pre-requisites before hand , and install them before installing the SharePoint Server 2010 . You still need to run the pre-requisites checker , it will check the required  software’s , and if you had installed all the pre-requisites properly , it will display the list showing that they are already installed. Here is blog entry from Jie Lie listing all the pre-requisites and from where to download them. 

I really didn’t hit any other issues resulting from limited resources , and from software side following blog posts and link  makes things extremely easy.

SharePoint 2010 Installation



SharePoint 2010 Profile Synch


Now I am planning to add another server containing  “FAST Server Server 2010” , I am sure it will require me to limit RAM from some of the existing VM’s .