Tuesday, August 28, 2012

Cannot Access File 'XXXX' because it is being used by another process - Error on Copying DLL to GAC

This post highlights one of the most common development environment issue you would encounter, when you try to show your tricky deployment steps.

Problem
Most of you all would not depend on the fresh deployment, where there is a possibility to ‘GAC’ the DLL. But in some cases, you would get an error message as follows, when you would try to pull the old DLL out and to put the new DLL in.


Solution
      1.      Get the list of all the processes attached to the interested DLL.
      Use the following command to list all the processes along with the ID.
      Tasklist /m <DLL Name.dll>
      E.g :







     Terminate processes/services shown in that list.
     In my case I had to release the DLL from the SharePoint timer job and the SharePoint worker process. This can be achieved by restarting the SharePoint service and recycling the IIS Pool/resetting the IIS  Server respectively.

     2.   In some cases, having done the above steps would repeatedly showing the same error message as shown      at the start. In such circumstances, you need to consider certain application running in the server. This can be Visual Studio/PowerShell.
Restarting those application would help you to get rid of the above problem.

Thursday, July 5, 2012

Search Settings Properties - PowerShell

This time, I’m going to shed some light on how to set the property values for the Search setting page.
I have a web-application and it is having many site collection with variation site to support for different languages. Each variation site is having its own content. When the user search from a particular variation site, the results should be shown inside the variation site itself. For that, If I set the Search results location at site collection level, that will be applied all across to the variation sites as well. In order to avoid that, we need to set the Site Collection Search Center value to Do not use custom scopes.

Search Settings Page


So my question is, how are you going to set that property for wsp deployment scenarios. When it comes to large level of projects with multiple site collection with variation sites, configuration are the pain points in the deployment process.
In order to automate and set the property values, I choose the PowerShell script.

The page is setting the values from the values stored in the Root web, property bag.

E.g:
In order to set the Site Collection Search Center value,

$web = Get-SPWeb –Identity http://server1/
$web.AllProperties[“SRCH_ENH_FTR_URL”] = “/en/SearchCenter/Pages”
$web.Update()


If you want to select the second radio button,

$web = Get-SPWeb –Identity http://server1/
$web.AllProperties[“SRCH_ENH_FTR_URL”] = $NULL
$web.Update()


If you want to select the second dropdown item, (Refer the table below for setting other values in that dropdown)

$web = Get-SPWeb –Identity http://server1/
$web.AllProperties[“SRCH_SITE_DROPDOWN_MODE”] = “HideScopeDD_DefaultContextual”
$web.Update()


If you want to set the search results page url,

$web = Get-SPWeb –Identity http://server1/
$web.AllProperties[“SRCH_TRAGET_RESULTS_PAGE”] = “/en/searchcenter/searchPages/”
$web.Update()



Key
Value
SRCH_ENH_FTR_URL
NULL or URL
SRCH_SITE_DROPDOWN_MODE
SRCH_TRAGET_RESULTS_PAGE
URL



Tuesday, June 19, 2012

Hide Selection Check Box in the Web Part Title Using a Content Editor

Recently I was engaged in a OOTB SharePoint project. I got a requirement to remove the Select Deselect check box which is shown to the anonymous users as well. Since the master page cannot be customized I used a simple trick using a content editor web part.





1) Add a content editor web part in the page which the check box has to be removed.
2) Simply add the following style to the content editor
  <style>
    .ms-WPHeaderTdSelection
    {
         display none;
     }
  </style>

Remember to set the Chrome type to None since this web part is a hidden one.Save and publish the page.

Sunday, February 19, 2012

Application Server Role: Web Server (IIS) Role: Configuration Error

Scenario
Last week was full of challenge on integrating SharePoint 2010 with JDEdwards ERP system. But the challenge turn around to a new dimension on migrating the SharePoint 2007 to SharePoint 2010 in Widows SBS 2008. Even though Microsoft has released a white paper here on how to migrate specifically on SBS 2008 server, there are few arguments going on with the validity and the comprehensiveness of the above white paper.

Problem
I ran into a trouble when I start to execute the Step 5, where the pre-requisites were not installed successfully, rather ended up with an error message saying  “Application Server Role: Web Server (IIS) Role: configuration error”. The error log repeated log the above line more than 25 times.

Solution
After few hours of googling,
  • Verify whether “World Wide Web Publishing Service” is started
  • Install  KB971831

After doing above steps, I could able to successfully re-install the pre-requisites and continue on with SharePoint migration.

Wednesday, February 1, 2012

Download SharePoint 15 Tech Preview SDK

SharePoint 15 Technical Preview Managed Object Model SDK contains reference topics focusing only on types and members that are called by other Microsoft applications.
This reference does not document the full SharePoint 15 managed object model. That documentation will accompany a later release of SharePoint 15.