Wednesday, March 27, 2013

SharePoint 2010 WSP BackUp

Simple script but very helpful considering the fact that it's easy to mess up and than end up trying to find  old WSP in your source control tool. (If your team has been updating the source control :-)).


Always take WSP backup from SharePoint Farm before you deploy revised one.


$farm = Get-SPFarm
$file = $farm.Solutions.Item("{WSPNAME}.wsp").SolutionFile
$file.SaveAs("C:\Backup\{WSPNAME}.wsp")



-Rags

Friday, February 15, 2013

Claim Based Security explained in real simple way

Check this article if you are trying to understand claims based security
http://msdn.microsoft.com/en-us/library/ff359108.aspx


Sunday, February 10, 2013

Office Web Apps and SharePoint Services(Excel, Word, Powerpoint Services)

I always get queries from peers and clients on difference between SharePoint 2010 and Office Web Apps. They are completely different component. Office Products have tight integration with SharePoint using the Office Web Apps feature installed in SharePoint.

Note : You can run Office Webs Apps using Office Web Apps server even if you do not have SharePoint in your organization.

Useful Links:

Office Web Apps:
http://technet.microsoft.com/en-us/library/jj219456.aspx


Office Web App Server Planning:
http://technet.microsoft.com/en-us/library/jj219435.aspx

Office Web Apps Deployment :
http://technet.microsoft.com/en-us/office/ee815687.aspx

Office Web Apps platform comparison
http://technet.microsoft.com/library/ff925944(office.14).aspx

Excel Services vs Excel Web App
http://blogs.technet.com/b/tothesharepoint/archive/2010/07/21/excel-services-and-excel-web-apps-common-different-features.aspx

Licensing
http://office.microsoft.com/en-us/buy/microsoft-office-volume-licensing-suites-comparison-office-FX101825637.aspx




Tuesday, January 15, 2013

Detect Content DB orphans and delete in a SharePoint 2010 Farm thru Windows PowerShell


Detect orphans in Content DB:

SCRIPT
----------------------------------------------------------------------------------------------------------------------------------
if ( (Get-PSSnapin -Name Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue) -eq $null ) 
     {Add-PSSnapin Microsoft.SharePoint.Powershell}
       set-location "C:\Program Files\Common Files\Microsoft Shared\web server extensions\14\BIN"
         $SPFarm = Get-SPFarm
           $contentWebAppServices = (Get-SPFarm).services | ? {$_.typename -eq "Microsoft SharePoint Foundation Web Application"} 

               foreach ($SPWebApp in $contentWebAppServices.WebApplications)
                 {
                   foreach ($SPSite in $SPWebApp.Sites)
                     {
                       Write-Host "Going thru Site Collection" $SPSite.Url
                         $SPSite.Url >> C:\SPSiteOrphanObject.txt
                           stsadm.exe -o databaserepair -url $SPSite.Url -databasename $SPSite.ContentDatabase.Name >> C:\SPSiteOrphanObject.txt
                             $SPSite.Dispose()
                               }}
                              ----------------------------------------------------------------------------------------------------------------------------------
                              • To delete orphan objects from a particular site use following script 
                              if ( (Get-PSSnapin -Name Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue) -eq $null ) 
                               {Add-PSSnapin Microsoft.SharePoint.Powershell}
                               set-location "C:\Program Files\Common Files\Microsoft Shared\web server extensions\14\BIN"
                              stsadm.exe -o databaserepair -url -databasename  >> C:\SPSiteOrphansDelete.txt

                              Note
                              • You can get the Content DB of a particular site collection using below script
                              $site=Get-SPSite
                              write-host $site.ContentDatabase.Name
                              
                              
                              
                              
                              
                              

                              Monday, September 17, 2012

                              Service Unavailable – HTTP Error 503. (SharePoint 2010)

                              When you try to load the page you probably might end up with following error:
                              Service Unavailable – HTTP Error 503

                              First Shot

                              Check Application Pool, most probably it will be turned off. Turn it on and test the portal.


                              If App Pool shuts down once more than

                              Second Shot 


                              Check the eventvwr
                              I had following error message:(not pasting the whole message but the important pointer)

                              The exception message is: Exception has been thrown by the target of an invocation.. ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.InvalidOperationException: The farm is unavailable. at Microsoft.SharePoint.Administration.Claims.SPSecurityTokenServiceManager.


                              If your error message is same as mine then try this resolution:

                              Open Application Pool - > Advanced Settings - > Enable 32 Bit Application and Set to FALSE


                              Hope that fixes your error.

                              Have Fun!!!




                              Tuesday, September 11, 2012

                              Admin SVC must be running in order to create deployment timer job

                              Error

                              This error message pops up when solution is installed using powershell command

                              Install-SPSolution -identity test.wsp -webapplication http://test/

                              Resolution

                              Method 1:
                              Go to Administrative Tools > Services and browse to find “Sharepoint 2010 Administration”.
                              Start  Service

                              Method 2:
                              Start-Service SPAdminV4





                              Error Deploying WSP using Visual Studio 2010

                              Issue:

                              Error occurred in deployment step 'Activate Features': Feature with Id  is not installed in this farm, and cannot be added to this scope.


                              Resolution:
                              This is mainly due to inability of Visual Studio 2010 to deploy solution in farm.try deploying the WSP using powershell command in each web front end SharePoint server in farm.

                              Check this article:
                              http://blogs.msdn.com/b/calvarro/archive/2011/11/06/sharepoint-2010-amp-visual-studio-2010-error-ocurred-activate-features-feature-with-id-installed-in-this-farm-cannot-be-added-to-this-scope.aspx

                              Wednesday, July 11, 2012

                              Storing values in SharePoint 2010 Property Bag

                              Property bags?
                              Property bags are place to store metadata or properties.The property bags are implemented as hash table consisting of property names and values.

                              Property bags can be defined at following levels:


                              • Farm (SPFarm class) 
                              • Web application (SPWebApplication class) 
                              • Site collection (SPSite class) 
                              • Site (SPWeb class) 
                              • List (SPList class)


                              Property bags can be set using SharePoint designer and programmatically.

                              Using SharePoint Designer 2010:

                              • Open Site in SharePoint Designer 2010
                              • Go to Site->Site Options
                              • Click on Parameters tab where you can see the list of existing properties, from the same place you can even perform add/modify/remove actions.


                              Programmatically

                              To Read the Set Key:


                              SPSite siteCollection = new SPSite("");
                              SPWeb website = mySite.RootWeb;
                              string MyValue = website.AllProperties["KeyName"]);

                              To Set the Value
                              SPSite siteCollection = new SPSite("  ");
                              SPWeb website = mySite.RootWeb;
                              website.Properties.Add(" KeyName ", "KeyValue");
                              website.Properties.Update






                              Monday, June 25, 2012

                              Adding DLL to WSP SharePoint 2010

                              In order to add custom dll to WSP Package , follow these steps:

                              • Create new Empty SharePoint Project 
                                • File->New->Project->SharePoint(2010)->Empty SharePoint Project 
                                • In second screen provide test site URL
                                • Select "Deploy as Farm Solution"

                              • Expand package node and double click on Package.package file 




                              • Click on "Advanced" Tab



                              • Add the Custom dll's using the "Add" button



                              • Save the project, compile and deploy. Custom dll will be part of WSP.

                              Enjoy!!!!

                              Rags

                              Wednesday, June 13, 2012

                              SharePoint Foundation 2010 Best Practice

                              Sandbox Solution Capabilities

                              Complete Article :http://msdn.microsoft.com/en-us/library/ee231562.aspx

                              In Nutshell


                              Sandboxed solutions support the following capabilities and elements:

                              Content Types/Fields

                              Custom actions

                              Declarative workflows

                              Event receivers

                              Feature callouts

                              List Definitions

                              List Instances

                              Module/files

                              Navigation

                              Onet.xml

                              SPItemEventReceiver

                              SPListEventReceiver

                              SPWebEventReceiver

                              Support for all Web Parts that derive from System.Web.UI.WebControls.WebParts.WebPart

                              Web Parts

                              WebTemplate feature elements (instead of Webtemp.xml)

                              Visual Web Parts

                              Sandboxed solutions do not support the following capabilities and elements:

                              Application Pages

                              Custom Action Group

                              Farm-scoped features

                              HideCustomAction element

                              Web Application-scoped features

                              Workflows with code



                              Monday, June 11, 2012

                              Get Machine Name and IP ASP.NET

                              My previous post has an function which is now deprecated.
                              http://metahat.blogspot.com/2009/09/get-client-machine-name-aspnet.html
                              System.Net.Dns.GetHostByAddress(Request.UserHostAddress).HostName


                              Following are the new function to get client machine name and IP address:

                              string[] computer_name = System.Net.Dns.GetHostEntry(Request.ServerVariables["remote_addr"]).HostName.Split(new Char[] { '.' });
                                                      
                              string machineName=computer_name[0].ToString();
                              string ipAddress  =Request.ServerVariables["REMOTE_ADDR"].ToString();

                              Wednesday, June 06, 2012

                              Powershell Commands (Mostly Used)

                              Here is collection of commonly used powershell cmdlets.
                              More details :
                              http://technet.microsoft.com/en-us/library/ee906565.aspx

                              Add-SPSolution(Uploads a SharePoint solution package to the farm.)
                              Add-SPSolution -LiteralPath c:\contoso_solution.wsp

                              Remove-SPSolution(Removes a SharePoint solution from a farm.)
                              Remove-SPSolution -Identity contoso_solution.wsp

                              Install-SPSolution(Deploys an installed SharePoint solution in the farm.)
                              Install-SPSolution -Identity contoso_solution.wsp -GACDeployment

                              Uninstall-SPFeature(Uninstalls an installed feature definition.)
                              Uninstall-SPFeature -path "MyCustomFeature"

                              Add-SPUserSolution(Uploads a new sandboxed solution to the solution gallery.)
                              Add-SPUserSolution -LiteralPath c:\contoso_solution.wsp -Site http://sitename

                              Disable-SPFeature(Disables an installed SharePoint Feature at a given scope.)
                              Disable-SPFeature –identity "MyCustom" -URL http://somesite

                              Enable-SPFeature(Enables an installed SharePoint Feature at the given scope.)
                              Enable-SPFeature –identity "MyCustom" -URL http://somesite

                              Get-SPFeature(Returns the SharePoint Features based on a given scope)
                              Get-SPSite http://somesite | Get-SPWeb –Limit ALL |%{ Get-SPFeature –Web $_ } | Select DisplayName,ID -Unique

                              Install-SPFeature(Installs a SharePoint Feature by using the Feature.xml file.)
                              Install-SPFeature -path "MyCustomFeature"

                              Uninstall-SPFeature(Uninstalls an installed feature definition)
                              Uninstall-SPFeature -path "MyCustomFeature"


                               

                              SharePoint 2010 101 Code Samples

                              Monday, June 04, 2012

                              Error while Installing SharePoint Foundation 2010 to Win 7 Desktop

                              Error:
                              Setup is unable to proceed due to following error(s):
                              This product required Windows Server 2008 Service pack 2 or above.
                              Correct the issue(s) listed above and re-run set up.

                              Solution:
                              In Order to install SharePoint 2010 Foundation/Office Server 2010, you need to make changes to configuration settings.

                              Refer article below:
                              http://msdn.microsoft.com/en-us/library/ee554869.aspx

                              -Rags

                              Friday, June 01, 2012

                              Deploying SharePoint 2010 Package using VS 2010

                              Well today i created a solution package and tried to deploy it to SharePoint 2010 portal hosted in separate server.Though it sounds such a straight forward step, i managed to get a nice long error message stating :


                              Error occurred in deployment step 'Recycle IIS Application Pool': Cannot connect to the SharePoint site. Make sure that this is a valid URL and the SharePoint site is running on the local computer. If you moved this project to a new computer or if the URL of the SharePoint site has changed since you created the project, update the Site URL property of the project

                              So i was back to my favorite page "google.com". (Not sure what would have been life of a techi if search engines would not had been there ;-) .)

                              So i came to know that currently Visual Studio 2010 only supports deployment of packages to locally installed SharePoint instance.So no remote support yet.

                              if you want to deploy to remote server than there are multiple ways to achieve this one :
                              http://msdn.microsoft.com/en-us/library/aa544500(office.14).aspx



                              Error while deploying package using Visual Studio 2010 to SharePoint 2010

                              Errors
                              Cannot access the local farm. Verify that the local farm is properly configured, currently available, and that you have the appropriate permissions to access the database before trying again.

                              OR


                              Error occurred in deployment step 'Recycle IIS Application Pool': The local SharePoint server is not available. Check that the server is running and connected to the SharePoint farm.


                              Reason

                              The error pops up when userid doesn't have access to configuration and content DB.

                              Resolution
                              There are 2 ways to resolving this issue.

                              Preferable Method(1st method): 
                              Use Power shell command to provide user id access to SharePoint DB's.

                              • "Add-SPShellAdmin -UserName domain\username" This will add permissions to the config database in SharePoint 2010
                              • "Get-SPContentDatabase -WebApplication " This will return information on the content database for the desired web application
                              • "Add-SPShellAdmin -UserName domain\username -database " This will add permissions to the content database for the desired web application



                              2nd method:
                              Add the userid as DBOwner to Configuration and Content DB. Though this is not best practice but will at least get you going.

                              -Rags




                              Tuesday, May 01, 2012

                              Unable to display this webpart error when connected to data using BCS services

                              Well in my case it was a known issue, data throttling. Challenge was not to fix the issue but was to figure out what the issue is .

                              Generic error like "Webpart error" doesn't help.

                              1) First issue was to figure out the issue.

                              Solution :
                              Use ULS Viewer, it's very handy in such situation :
                              http://ulsviewer.codeplex.com/releases/view/19835

                              2) How to throttle the data. This one was a quick one. Pretty good article in this team blog.

                              http://blogs.msdn.com/b/bcs/archive/2010/02/16/bcs-powershell-introduction-and-throttle-management.aspx


                              -Raghu Iyer




                              Thursday, December 15, 2011

                              WF Rule Engine

                              If you are trying to author Rules using the WF rule engine than 2 samples are must for reference . These are old samples but works like charm :


                              Samples :
                              External ruleset toolkit
                              Ruleset analyzer

                              Thursday, October 20, 2011

                              SOAP Request Testing Tool

                              I am been using the SoapUI tool for quite some time and it's pretty impressive.

                              You can get it from :
                              http://www.soapui.org/

                              In order to work with Soap Request which needs authentication , there is a tab "AUT" wherein your can specify credential.
                              http://www.soapui.org/SOAP-and-WSDL/authenticating-soap-requests.html

                              Saturday, October 15, 2011

                              Resource not found 404 error ( WCF Data service hosted with MVC ASP.NET)

                              Scenario: MVC ASP.NET application containing WCF data services. When you try to browse WCF data service .svc page you might get the error
                              "Resource not found -404 error" .

                              Reson for such behavior : When you try to browse to data service page , the request is sent to MVC framework first rather than data service . As the controller is not defined for such request , error is send back.

                              Resolution :Ignore request redirection to MVC framework when WCF data service is requested .In order to achieve this add following to global.asax RegisterRoute function.

                              routes.IgnoreRoute("{resource}.svc/{*pathInfo}");

                              Friday, September 30, 2011

                              System.Data.Entity.DbUpdateException

                              {System.Data.Entity.DbUpdateException: An error occurred while saving entities that do not expose foreign key properties for their relationships. The EntityEntries property will return null because a single entity cannot be identified as the source of the exception. Handling of exceptions while saving can be made easier by exposing foreign key properties in your entity types. See the InnerException for details. ---> System.Data.UpdateException: An error occurred while updating the entries. See the inner exception for details. ---> System.ArgumentException: Parameter value '12.50000' is out of range.
                              at System.Data.SqlClient.TdsParser.TdsExecuteRPC(_SqlRPC[] rpcArray, Int32 timeout, Boolean inSchema, SqlNotificationRequest notificationRequest, TdsParserStateObject stateObj, Boolean isCommandProc)
                              at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async)
                              at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result)
                              at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe)
                              at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
                              at System.Data.Mapping.Update.Internal.DynamicUpdateCommand.Execute(UpdateTranslator translator, EntityConnection connection, Dictionary`2 identifierValues, List`1 generatedValues)
                              at System.Data.Mapping.Update.Internal.UpdateTranslator.Update(IEntityStateManager stateManager, IEntityAdapter adapter)
                              --- End of inner exception stack trace ---
                              at System.Data.Mapping.Update.Internal.UpdateTranslator.Update(IEntityStateManager stateManager, IEntityAdapter adapter)
                              at System.Data.EntityClient.EntityAdapter.Update(IEntityStateManager entityCache)
                              at System.Data.Objects.ObjectContext.SaveChanges(SaveOptions options)
                              at System.Data.Entity.Internal.InternalContext.SaveChanges()
                              --- End of inner exception stack trace ---





                              Got above error while performing database.save() of Entity Model .

                              The reason for failure was the decimal field in DB which was set for DECIMAL(6,5) whereas the value trying to be saved was 12.00000 .

                              This is how it works :

                              e.g.
                              decimal of (4,1) can hold upto 999.9
                              decimal of (3,1) can hold upto 99.9

                              Tuesday, September 13, 2011

                              Executing Java .jar within .NET

                              using System.Diagnostics;



                              Process process = new Process();

                              //Path wherein Java is installed in your machine
                              process.StartInfo.FileName = "java.exe";
                              //.jar file to be executed
                              process.StartInfo.Arguments = @"-jar Sample.jar";

                              process.StartInfo.UseShellExecute = false;

                              process.StartInfo.RedirectStandardOutput = true;

                              process.StartInfo.RedirectStandardError = true;

                              process.Start();

                              //Get the output from stream
                              Console.WriteLine(process.StandardOutput.ReadToEnd());

                              //in case of no error ExitCode will be zero
                              if(process.ExitCode)
                              {
                              //In case of error , get error description
                              string error = process.StandardError.ReadToEnd();
                              }

                              Console.WriteLine(error);

                              process.WaitForExit();

                              Tuesday, August 16, 2011

                              An entity object cannot be referenced by multiple instances of IEntityChangeTracker.

                              I got this error due to using separate context object for an entity. I had to use same context object to perform multiple operations in Entity .

                              Friday, August 12, 2011

                              Request Error



                              Getting generic request error while browsing ?Set the includeExceptionDetailInFaults = true in web.config in order to get some descriptive error message.














                              Specified named connection is either not found in the configuration, not intended to be used with the EntityClient provider

                              I got this error when i was trying to browse the WCF data Services. The resolution for this issue was to define the connection string for database defined in in app.config file to the web.config file of the web application.

                              In Nutshell , below is my scnerio :

                              Project 1 : Contains the .edmx and app.config file

                              Project 2 : Contains the .SVC referencing entity model defined in project 1 and web.config file

                              Resolution :
                              Copy the Db connection defined in app.config to web.config under configuration section .

                              Thursday, July 21, 2011

                              Format ComboBox ExtJS

                              items: [
                              {
                              xtype: 'combobox',
                              fieldLabel: 'State',
                              store: 'TestStore',
                              queryMode: 'local',
                              displayField: 'State',

                              listConfig: {
                              getInnerTpl: function () {

                              return '
                              {State}:{status}
                              ';
                              }
                              }

                              }

                              Tab Inside a Tab ExtJS

                              Ext.create('Ext.TabPanel', {
                              renderTo: Ext.getBody(),
                              id: 'main-tabs',
                              height: 300,
                              width: 600,
                              activeTab: 0,
                              defaults: {
                              padding: 10
                              },
                              items: [{
                              xtype: 'tabpanel',
                              title: 'Tab 1',
                              id: 'tab1',
                              activeTab: 0,
                              padding: 5,
                              border: true,
                              plain: true,
                              defaults: {
                              padding: 10
                              },

                              items: [{
                              title: 'Sub-tab 1',
                              id: 'subtab1',
                              html: 'Sub-tab 1 content'
                              },{
                              title: 'Sub-tab 2',
                              id: 'subtab2',
                              html: 'Sub-tab 2 content'
                              },{
                              title: 'Sub-tab 3',
                              id: 'subtab3',
                              html: 'Sub-tab 3 content'
                              }]
                              },{
                              title: 'Tab 2',
                              id: 'tab2',
                              html: 'Tab 2 content'
                              },{
                              title: 'Tab 3',
                              id: 'tab3',
                              html: 'Tab 3 content'
                              },{
                              title: 'Tab 4',
                              id: 'tab4',
                              html: 'Tab 4 content'
                              },{
                              title: 'Tab 5',
                              id: 'tab5',
                              html: 'Tab 5 content'
                              }]

                              });
                              });

                              Adding panel to ViewPort (ExtJS)

                              Add Panels to ViewPort on the fly

                              1) Define ViewPort

                              viewport = Ext.create('Ext.container.Viewport', {
                              layout: {
                              type: 'border'
                              },
                              defaults: {
                              split: false
                              },
                              items: [{

                              region: 'center',
                              layout: 'border',
                              frame: false,
                              padding: '0 5 0 0',
                              border: false,
                              items: [{
                              region: 'center',
                              items: [
                              {
                              xtype: 'grid1'
                              }

                              ]
                              }]
                              },


                              {

                              region: 'south',
                              frame: false,
                              padding: '0 5 0 0',
                              border: false
                              }
                              ]
                              });


                              2) Add panel on the fly to defined region. In our example we are adding panel to "South" region

                              southRegion = viewport.getComponent(1);

                              southRegion .add(myPanel);

                              southRegion .setWidth(200);

                              southRegion .doLayout();



                              Tuesday, July 19, 2011

                              Remove Special character from String

                              string Formatted = Regex.Replace(, @"[\-]", "");

                              Regular Expression for YYYYMM

                              Well i managed to make this one for now. If you have better one please share .

                              YYYYMM

                              (^(19|20)\d{2})((0[1-9])|(1[0-2])$)

                              e.g.
                              PASS : 200901 , 201012 ...

                              FAILS :211001 , 200913 ...

                              Sunday, July 17, 2011

                              Timeout Ext.Ajax.request

                              Set :

                              Ext.Ajax.timeout = < millisecond >;

                              e.g.

                              Ext.Ajax.timeout = 90000;

                              Friday, July 08, 2011

                              Get Security Information from Client

                              In order to get the security information from client in a Service , use the following Class :

                              ServiceSecurityContext Class

                              ServiceSecurityContext.Current.WindowsIdentity.Name
                              ServiceSecurityContext.Current.PrimaryIdentity.Name

                              More Information:
                              http://msdn.microsoft.com/en-us/library/system.servicemodel.servicesecuritycontext.aspx

                              Wednesday, June 22, 2011

                              Message: Expected identifier, string or number

                              If you get this error in your Ext JS page , then there is big possibility that you have added a extra comma which is not required .

                              E.g.
                              Incorrect entry
                              {
                              title: 'Main Content',
                              collapsible: false,
                              region: 'center',
                              layout: 'fit',
                              margins: '5 0 0 0',
                              xtype: 'panelbais' , }

                              Correct entry

                              {
                              title: 'Main Content',
                              collapsible: false,
                              region: 'center',
                              layout: 'fit',
                              margins: '5 0 0 0',
                              xtype: 'panelbais' }


                              Check out the last comma before the closing curly braces .

                              Monday, June 20, 2011

                              'undefined' is null or not an object in ext-all.js

                              One more ext-all.js error . This time it was due to extra comma in object literal definition.

                              Resolution :
                              Find and remove extra comma.

                              'flex' is null or not an object in ext-all.js

                              I got this error for quite some time and i had no clue what was wrong in my page . Page consisted of only 2 panel controls . That's all

                              After playing around with some of properties of panel , the issue was resolved.

                              Issue in my case :
                              First panel had property layout: 'anchor'
                              Second Panel had property layout: 'border '


                              Resolution :
                              Changed the second panel property layout: 'anchor'

                              This might not be your case . This error is very generic and can pop up due to multiple reasons .


                              Ext JS : Data Model proxy for Json and XML return type

                              JSON RETURN DATA

                              If you data is returned in JSON format then your proxy for Data Model will look like :
                              Ext.define("Post", {
                              extend: 'Ext.data.Model',
                              proxy:
                              {
                              type: 'rest',
                              url : 'http://xyz.com/ID/18/',
                              reader: {
                              type: 'json',
                              root: 'CUSTOMER'
                              }
                              }



                              XML Return Data

                              Ext.define("Post", {
                              extend: 'Ext.data.Model',
                              proxy: {
                              type: 'ajax',
                              url : 'http://xyz.com/ID/18',
                              reader: {
                              type: 'xml',
                              record: 'CUSTOMER'
                              }
                              },

                              Ext JS Programming Basic Requirement

                              So , if you have started working with Ext JS make sure you are using the following tools . Believe me they are quite handy and saves you from head banging ;-)

                              1) Fiddler
                              2) Scripting client
                              3) REST Service Tested ( Firefox)
                              4) Firebug


                              Thursday, June 16, 2011

                              Could not find default endpoint element that references contract 'x' in the ServiceModel client

                              Scenario :

                              I was creating a WCf client to test the services . After creating client proxy and testing the services i bumped into below error. It seems the configuration in my app.config was not correct.

                              ERROR:
                              {System.InvalidOperationException: Could not find default endpoint element that references contract 'x' in the ServiceModel client configuration section. This might be because no configuration file was found for your application, or because no endpoint element matching this contract could be found in the client element.


                              Resolution :
                              When you generate client using the svcutil.exe , an output.xml is generated. This file contains the end point configuration information . Take the configuration from this file and add it to app.config. Service should work without configuration issue assuming your code is not erroneous ;-)


                              Wednesday, June 15, 2011

                              Visual Studio IntelliSense to show comments for the Custom Function

                              If you added Summary to your custom defined function and it's still now showing description as part of Visual Studio IntelliSense then for sure you are missing a setting .

                              e.g.

                              ///<summary>
                              This is test function
                              ///</summary>

                              public void TestFunction()
                              {
                              //Do something...
                              }



                              when you access this function , you expect the description to show up but in case its shows nothing . Then do this :

                              1) Open Projects property page
                              2) Click the Build Tab
                              30 Check the "Xml documentation file " checkbox


                              Compile project and try once more ...



                              Wednesday, June 08, 2011

                              Accessing Enterprise Application Blocks

                              There are mutiple ways to access application blocks :

                              Using the Enterprise Library Service Locator

                              var writer = EnterpriseLibraryContainer.Current.GetInstance();
                              writer.Write("I'm a log entry created by the Logging block!");


                              var customerDb
                              = EnterpriseLibraryContainer.Current.GetInstance("Customers");


                              The Sophisticated Approach — Accessing the Container Directly

                              var theContainer = new
                              UnityContainer().AddNewExtension();


                              var writer = theContainer.Resolve();
                              writer.Write("I'm a log entry created by the Logging block!");

                              var customerDb = theContainer.Resolve("Customers");



                              Check out this diagram :
                              http://msdn.microsoft.com/en-us/library/Ff953191.441da4ba-fa2e-4da3-bac1-89897580d80b(l=en-us,v=PandP.50).png

                              Wednesday, December 08, 2010

                              Prism with Silverlight : Short Videos but covers topic really well

                              Creating a shell and modules
                              http://channel9.msdn.com/blogs/akmsft/creating-a-modular-application-using-prism-v2-part-1-of-4--creating-a-shell-and-modules

                              Visual Composition
                              http://channel9.msdn.com/blogs/akmsft/creating-a-modular-application-using-prism-v2-screencast-24--visual-composition

                              Implementing views and services
                              http://channel9.msdn.com/blogs/akmsft/creating-a-modular-application-using-prism-v2-screencast-34--implementing-views-and-services


                              Decoupled Communication
                              http://channel9.msdn.com/blogs/akmsft/creating-a-modular-application-using-prism-v2-screencast-44--decoupled-communication

                              Wednesday, August 18, 2010

                              SharePoint 2010 as Application Development Framework

                              When i started working on SharePoint , i never thought it to be more than a document management system . Even today when i mention SharePoint i know what's in the end user mind( Document , Document , Document .......) .

                              SharePoint has changed so drastically within past decade. I was always excited about the fact that it's possible to develop custom application using SharePoint 2007 as base framework . We did multiple implementation and development time has reduced around 50 % . Reason is that we dont need to spend time doing too much data modelling obviously there is downside to it as complex data centric application is not real contender for such efforts and neither transaction based application . But what i have seen as per my experience is that in any organization there are very few key applications which are complex and they are mostly business drivers other are small custom applications just to automate business process and no surprise that these small applications sometimes makes more than 50% of the applications in an organizations and are good contender to be developed using SharePoint as framework .

                              Custom applications developed on top of SharePoint 2007 comes with drawbacks too , biggest evil is performance. Too much of data will drain the server resouces and might take ages to load pages. So i would say application development in SharePoint 2007 has proven to be more of POC and learning platform.

                              SharePoint 2010 seems to much more mature with its 64 bit architecture and promises to provide deliver better performance.

                              Story cut short , non business centric applications will be developed using SharePoint in future. So if you would like to equip yourself then refer the below URL :

                              http://www.microsoft.com/downloads/details.aspx?FamilyID=64b55569-2168-4545-8b7c-f185b2cf967d&displaylang=en

                              SharePoint 2010 Resources

                              If you are looking for one stop shop for SharePoint resources than this one is good place to start with :
                              http://blogs.technet.com/b/vedant/archive/2010/06/14/sharepoint-2010-resource-guide.aspx

                              and if you are the ones who prefer videos than here is the link :

                              http://sharepoint.microsoft.com/en-us/Pages/Videos.aspx?VideoID=14

                              SharePoint 2010 Edition Comparison with Quick Details

                              http://sharepoint.microsoft.com/en-us/buy/Pages/Editions-Comparison.aspx

                              Friday, May 14, 2010

                              Versions of SharePoint 2010

                              There are four versions of SharePoint Server 2010 as specified in following URL :

                              http://technet.microsoft.com/en-us/evalcenter/ee388573.aspx

                              SharePoint Server 2010 Enterprise Client Access License features

                              For organizations looking to expand their business collaboration platform to enable advanced scenarios. Use the Enterprise capabilities of SharePoint to fully interoperate with external line-of-business applications, Web services, and Microsoft Office client applications; make better decisions with rich data visualization, dashboards, and advanced analytics; and build robust forms and workflow-based solutions.

                              SharePoint Server 2010 for Internet Sites, Enterprise

                              For organizations looking to create customer-facing public internet sites and private extranets using the full enterprise capabilities of SharePoint. This provides full SharePoint Enterprise functionality and no other technical limits.

                              SharePoint Server 2010 Standard Client Access License features

                              For organizations looking to deploy a business collaboration platform across all types of content. Use the core capabilities of SharePoint to manage content and business processes, find and share information and expertise, and simplify how people work together across organizational boundaries.

                              SharePoint Server 2010 for Internet Sites, Standard

                              For small and mid-sized organizations looking to create public Internet sites or basic extranets using the Standard features of SharePoint Server 2010.

                              SharePoint 2010 Product key

                              Here goes product keys for SharePoint 2010 Release Version:

                              SharePoint Server 2010 Enterprise Client Access License Features: GGDG8-JCMXH-8KG8C-RJYYX-3Y33H
                              SharePoint Server 2010 for Internet Sites, Enterprise: 9FPGB-W6QTT-G68T4-TBX7M-R624H
                              SharePoint Server 2010 Standard Client Access License Features: KB443-F7CJV-J2RP4-QYQJ7-6PBB3
                              SharePoint Server 2010 for Internet Sites, Standard: H4P2T-CYKM7-9FKKD-DTQ7X-W69GG

                              http://technet.microsoft.com/en-us/evalcenter/ee391660.aspx


                              HAPPY SHAREPOINTING!!!!

                              Tuesday, May 04, 2010

                              Retrieve Solution file from SharePoint Farm

                              Situation :
                              Developer created .wsp file and installed in SharePoint farm . We need install these solution files to new farm and we have no clue where developer has saved these files.It's not in Visual Source safe too.

                              Disaster Recovery :
                              Pull the .wsp from the existing farm using code below :

                              SPSolutionCollection solutions = SPFarm.Local.Solutions;

                              foreach (SPSolution solution in solutions)
                              {
                              SPPersistedFile wspFile = solution.SolutionFile;
                              wspFile.SaveAs("c:\\Temp\\Solutions\\" + solution.Name);
                              }

                              Make sure directory exists .

                              Enjoy!

                              Tuesday, April 27, 2010

                              System.Data.SqlClient.SqlError: Exclusive access could not be obtained because the database is in use. (Microsoft.SqlServer.Express.Smo)

                              I got this error while i was trying to restore SSP SQL Backp from source farm to new target farm SSP DB. Obviously DB by used by different processes which caused this error.

                              I did following steps to get it working( Make sure you can afford SQL DB outage during the restore )

                              1) Run the following SQL Query on SSP DB

                              USE master
                              GO

                              ALTER DATABASE   YOUR_SSP_DB_NAME
                              SET OFFLINE WITH ROLLBACK IMMEDIATE

                              2) Perform SQL Restore from Backup

                              3)
                              ALTER DATABASE    YOUR_SSP_DB_NAME
                              SET ONLINE


                              Thats It .

                              This process is much simpler than the Central Administration Restore process. For some weird reasons i kept on getting errors while trying with Central Administration console .

                              Wednesday, April 07, 2010

                              Content Query Web Part : Master of all OOB webpart

                              If you are looking for formatting sharepoint content as far as your imagination goes , you have to explore master of all OOB webpart "Content Query Web Part"

                              Customization Sample :
                              http://msdn.microsoft.com/en-us/library/bb447557.aspx

                              This is one of the most powerful webpart but still SharePointers avoid it's usage due to its complex looking .xsl language . Fact is that once you understand XSL then this webpart will become common in your websites.

                              The site collection could not be restored. Please make sure the content databases are available and have sufficient free space

                              "The site collection could not be restored. Please make sure the content databases are available and have sufficient free space "
                              Follow this article in case you bump on to above error :
                              http://support.microsoft.com/kb/926061

                              Thursday, March 11, 2010

                              Exception Error 0x80020009 when trying to Activate "Office Sharepoint Server Publishing Infrastructure"

                              If you face issue activating the Office SharePoint Server Publishing Infrastructure feature , try following these steps mentioned by Chris Winebarger

                              Following are the steps :

                              stsadm -o activatefeature -filename publishing\feature.xml -url http://URL -force

                              stsadm -o activatefeature -filename publishingresources\feature.xml -url http://URL -force

                              stsadm -o activatefeature -filename publishingSite\feature.xml -url http://URL -force

                              stsadm -o activatefeature -filename publishingweb\feature.xml -url http://URL -force

                              stsadm -o activatefeature -filename publishinglayouts\feature.xml -url http://URL -force

                              stsadm -o activatefeature -filename navigation\feature.xml -url http://URL -force

                              Worked for me ...

                              Monday, February 15, 2010

                              Thursday, January 21, 2010

                              Error in PortalCrawl Web Service.

                              People search was not working even after crawl and i saw this error message in error log.
                              To get it working i had to create a dummy root site collection at http://servername

                              Wednesday, January 06, 2010

                              Request for the permission of type 'System.Security.Permissions.FileIOPermission failed

                              Request for the permission of type 'System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.0.0, Culture=neutral,PublicKeyToken=b77a5c561934e089' failed

                              In case you receive security issue when executing the managed code infopath form , solution is to make the infopath form Full Trust.

                              To make form full trust , in Office Infopath design mode, go to Tools -> Form Options -> Security and Trust -> Full Trust (Change Security level to full trust ).

                              Publish theform .

                              Auditing SharePoint 2007 List/ Library

                              Auditing documents/ list items in SharePoint 2007 is a 3 step process :


                              1) Create Site Collection Policy
                              - Go to Site Actions ->Modify all Site Settings - >Site Collection Policies
                              - Create new policy -> Provide Name and Enable Auditing
                              - Select Events you would like to audit -> Click OK


                              2) Set up the Document Library / List which requires auditing
                              - Go to List Settings of Document Library you would like to audit
                              - Click on Information Management Policy Settings
                              - Under use site collection policy , select the policy you had defined in first step
                              - Click Ok

                              At this point you library / list is set for auditing and any action will be logged .

                              3) Viewing the results
                              - Go to Site Actions ->Modify all Site Settings - >Audit log Reports
                              - Under Custom Reports click on "Run a custom report "
                              - Select checkbox "Restrict this Report to " and select corresponding web application and list name
                              - You can select various filters (start date , end date , users ), though these are optional but its better to use them as they improve the report performance
                              - Select the events you would like to see the report for and click ok
                              - Voila ! you have the details reports with worksheet displaying the activity and usernames ,you have to use the filter to zero down to required data. UserNames can be accessed worksheet named"Report Data". Event column will display the action performed on a particular item

                              Enjoy !








                              Tuesday, January 05, 2010

                              HAPPY NEW YEAR !!!!

                              Happy New Year !! to all . This year is going to bring more interesting technology challenges.

                              Bring it on !!!!

                              Thursday, December 31, 2009

                              Another user has changed the structure of this list .

                              ERROR :
                              Another user has changed the structure of this list . All your pending changes to this list will be discarded . To retrieve the latest copy of the list , click refresh

                              Suggested Resolution : Removing comma in hyperlinks
                              Reference URL : http://bmerri19.wordpress.com/

                              Wednesday, December 30, 2009

                              Implementing ASP.NET Impersonation

                              Impersonation can be implemented using one of four methods:

                              • Impersonate the IIS authenticated account or user
                              • Impersonate a specific user for all the requests of an ASP.NET application
                              • Impersonate the authenticating user in code
                              • Impersonate a specific user in code

                              More details give in following article :

                              http://support.microsoft.com/kb/306158#4

                              Tuesday, December 22, 2009

                              Feature '7a8b11f4-38b2-402b-ad94-1213e25150ca' for list template '1102' is not installed in this farm. The operation could not be completed.

                              I got this error while performing export of SharePoint site with stsadm and sharepoint designer.
                              It was happening because ShaerPoint Site was searching for the following feature "PWAProposals" which was present in my dev machine and not in my production . I was able to move it successsfully before as i used stsadm-backup but it started failing with stsadm -export.

                              Resolution :
                              Just copy the feature from your source server ---> destination server and install the feature. This will resolve the issue . Well this is not ideal solution . I am still in process of figuring out the reference to the feature in order to remove it from list template.

                              Tuesday, December 08, 2009

                              Sharepoint Config DB Size Grown too large

                              In my case the SharePoint Config DB log size became 35 GB which ate up all the disk space nearly crashing the system . This is a development machine so disk space was limited to 50 GB .

                              Did some search and the below steps solved the issue. The steps given below is not recommended to be implemeted in production , only in development / QA machine in order to save some resource .

                              1) Right click on you DB -> Properties
                              2)Select Options
                              3) Change the Recovery Model to SIMPLE and Click Ok

                              Once that is done ,
                              -Right click on DB -> Tasks - > Shrink -> Files
                              - In File type select log and click OK

                              My Config DB Log files were reduced from 35 GB - > 504 KB

                              Note : Simple recovery model is not suggested for Production Systems

                              Wednesday, December 02, 2009

                              Allow Access Request SharePoint 2007

                              In order to set individual email ID to receve email when the Access is requested for a SharePoint Site , follow these steps :
                              1) Go To Site Settings ->Modify All Site Settings
                              2) Click on Advanced Permissions under User and Permission
                              3)List Settings -> Access Requests
                              4) Set the email ID and activate the Allow Request for access

                              SharePoint 2010 Beta Product Key

                              Well i did my installation of SharePoint 2010 Beta and found the product key here :

                              SharePoint Server 2010 Beta (Enterprise CAL features): PKXTJ-DCM9D-6MM3V-G86P8-MJ8CY
                              SharePoint Server 2010 for Internet Sites Beta, Enterprise: BV7VC-RMR6B-26P6Y-BTQDG-DX2KQ

                              http://technet.microsoft.com/en-us/evalcenter/ee391660.aspx

                              Sunday, November 29, 2009

                              Feature 1 SharePoint 2010 : Sandbox Solutions

                              This feature i am sure is one of the big enhancement in SharePoint 2010 . For all those developers out there who gave day and night to convince server admins that the developed code is safe and won't break the farm this is sign of relief.

                              Now the developers / Site administrator can get their custom code(restricted features) to the SharePoint site without concern .So in case there is bug in code then the only thing which will bomb is site owned by the team .

                              Farm administrator has total control over the deployed solution and can even define resource limit for the solution . It's win - win for the server admins as well as the site owners.

                              Less politics in organization now ;-) .

                              More details here

                              Atlast SharePoint 2010 Beta Installation complete

                              Today i completed my first SharePoint 2010 beta installation in my machine . AHHH what a relief, i have been planning to do this from past 2 weeks.

                              Well lets see how the new features turns up . I hope i can get some momentum now......

                              Friday, November 20, 2009

                              Exception from HRESULT: 0x80040E14 STSADM ERROR

                              In my case this error was purely due to lack of disk space in DB server.

                              ERROR:
                              Exception from HRESULT: 0x80040E14

                              Clearing hard disk space in DB server resolved the issue.

                              Tuesday, November 17, 2009

                              Unable to Delete SSP (unprovisioning)

                              If you are stuck with SSP and have no clue how to get rid of it then you are at right place.

                              Use the SharePoint Master Tool (STSADM), nobody says "no" to Master ;-)

                              stsadm -o deletessp -title [-deletedatabases] -[force]
                              http://technet.microsoft.com/en-us/library/cc263248.aspx

                              Friday, September 25, 2009

                              Cannot connect to the configuration database.

                              This might happen due to various reasons . Below are the most common reasons :
                              1) Check SQL DB exist and enabled
                              2) Application pool Identity has been added to SQL DB

                              SharePoint 2007 Best Practices

                              SharePoint Pattern and Practices

                              http://msdn.microsoft.com/en-us/library/dd203468.aspx

                              Tuesday, September 22, 2009

                              Save as Site Template Missing

                              Are you trying to save a publishing site as site template and are still wondering where the "Save as Site Template " is?

                              Well It's hidden . Here is a nice article for you.


                              Cheers!!!

                              Tuesday, September 08, 2009

                              Wednesday, August 05, 2009

                              AJAX ERROR : Sys.WebForms.PageRequestManagerTimeoutException - The server request timed out

                              Well if you have this error then its due to long running process as the default time out set is 90 seconds.
                              If you want to increase the time out value , then make change to the Script Manager attribute .
                              For e.g to increase it to 5 min :




                              (Click on image to enlarge it)

                              Thursday, July 23, 2009

                              Unknown server tag 'asp:ScriptManager' PKS

                              I had configured PKS (Podcasting Kit for SharePoint ) June 2009 release. Everything went smooth and even the application was working well except the encoding which i haven't yet tested .

                              Anyways after couple of days when i tried accessing the site the main page went KAPUT , i started getting this error "Unknown server tag 'asp"ScriptManager" .Now the question was "What might have gone wrong?" . I didn't even touched the site for 2 days and everything was working fine before (Typical sentence used by most developers -;)) .


                              After some search i found one article which asked to check the web.config file for some entries and it's weird those entries were gone from my web.config file. (Murphy's law in total effect ) .

                              Anyways as suggested i made the following entries ,In case image is not clear click on it to get better view.






                              I am glad website is back . Up and running .

                              Here is the link where i got the web.config entries .

                              ENJOY!!!




                              Monday, July 13, 2009

                              The template you have chosen is invalid or cannot be found. SharePoint Template Error

                              It's pretty hard to find the actual reason of these kind of error . But one thing is sure that template is causing issue.
                              The most common reason for this error is missing of dependency . for e.g. missing feature.
                              Best solution is to run the STPInspector tool . It will help to diagnose whether all the dependency are present in server or missing something .
                              You can get tool from STPINSPECTOR

                              ENJOY!!!

                              Essential SharePoint Governance Tool

                              Tool which you should have to administer/Develop SharePoint 2007 :

                              Thursday, July 09, 2009

                              Aspnet_merge.exe Exited with Code 1

                              I got this error while building the Web deployment project . After some search it came to my notice that class names in my webcontrols were same ,due to which build started bombing while merging the assembly .

                              I changed the class names and Voila ! it started working.




                              Creating single DLL for Web User Controls in ASP.NET website project

                              Are you trying to create single DLL for a web user control and end up getting multiple DLL's for each user control ?

                              Well you are in right place . The best option is to use web deployment project which is an Add in to Visual Studio .

                              Install the project template from here
                              http://msdn.microsoft.com/en-us/asp.net/aa336619.aspx


                              Once installed follow this article for creating a single DLL for your web project :
                              http://msdn.microsoft.com/en-us/library/aa479568.aspx

                              Friday, July 03, 2009

                              Microsoft New Search Engine

                              BING!!!!

                              I am impressed with the new search engine from Microsoft and i am glad it's fast.

                              Reference Architecture for AI-integrated Genomic Analytics on Oracle Cloud Infrastructure ( Published in Oracle Blog)

                               I have been thinking about writing this blog for some time. Genomics is a fascinating field and has potential to unlock so many hidden scie...