Thursday, January 24, 2013

Generating Public key token


Many times we need to get the Public key token for a strongly named assembly in .NET.  “how to get the public key token?”. Answer is very simple use the .NET Framework tools sn.exe. So open the Visual Studio 2008 Command Prompt and then point to the dll’s folder you want to get the public key,

I have used the following command, for generating public key token for a SharePoint project
sn.exe –T SPExcercise1.dll
Public key token is d95388ccbe5ad4c1
This will give you the public key token. 
Remember one thing this only works if the assembly has to be strongly signed.

Monday, January 21, 2013

soap:ServerServer was unable to process request. ---> Value does not fall within the expected range.


In some odd situation, SharePoint Designer (SPD) 2010 would throw this error:
“soap:Server was unable to process request. Value does not fall within the expected range”
Cause
SPD does not open the site with name it was originally defined.  For example, the site was created as http://xyzmachine:9999/, but SPD connects it as http://localhost:9999/
Solution
SPD should connect the site with name/url defined at its creation.

Wednesday, October 17, 2012

Microsoft.WindowsAzure.ServiceRuntime.RoleEnvironmentException


Few days ago, I was working on a Windows Azure App, I created a Web Role  which was representing my application interface. Its purpose was to upload images. I needed to generate thumbnails as well.I thought to delegate this responsibility to a Worker Role. 
My Web Role  add image to a Blob and add a message in queue as well for the worker role, so that it can read it and generate thumbnails for each queued image, later.
When I created a worker role and tried to access the storage account with my defined connection string, it started giving me RoleEnvironmentException , I set the connecting-string for the application so I thought it will work for both Web ad Worker Roles, but it was not the case.
For Windows Azure, we have to set connection string for every worker and web roles, independently. I hope this will help any new bee on Windows Azure. 
Thank You and Happy Coding.......

Tuesday, October 16, 2012

Datatable belongs to another dataset


DataTable already belongs to another DataSet this error we get when we are trying to add table into datatset which is already belonging to another dataset. So whats the solution?Its simpleUse Copy() method of DataTable to add to your dataset e.g.

objDataSet.Tables.Add( dataTableFromDataSetA.Copy() ); 

//here objDataSetis your Dataset and dataTableFromDataSetA is DataTable.


Hope this post save your time. Thank You.
Earn Money ! Affiliate Program
Open Directory Project at dmoz.org