Saturday, August 1, 2009
Operation is not valid due to the current state of the object
There is another cause to this error: using the "update" method in the "RunWithElevatePrivilege" scope, like this:
SPSecurity.RunWithElevatedPrivileges(delegate{
using (SPSite site = new SPSite("http://mySiteUrl"))
{
using (SPWeb web = site.OpenWeb())
{
SPListItem listItem = web.GetListItem("http://myItemUrl");
//do item modifications....
listItem.Update();
}
}
});
To resolve this issue, call the "update" method out of the "RunWithElevatedPrivileges" scope, like this;
SPSite site = null;
SPWeb web = null;
try
{
SPSecurity.RunWithElevatedPrivileges(delegate{
site = new SPSite("http://mySiteUrl");
web = site.OpenWeb();
});
SPListItem listItem = web.GetListItem("http://myItemUrl");
//do item modifications....
listItem.Update();
}
finally
{
if (site != null)
site.Dispose();
if (web != null)
web.Dispose();
}
Wednesday, July 22, 2009
Active Directory: How to get all related groups by user
Sunday, July 12, 2009
How to add Sharepoint Workflow Activities to Toolbox
Monday, July 6, 2009
SPWeb.RoleDefinitions.GetByType(SPRoleType.None)
The problem occured when i tried to copy Restricted Read role agginment.
Wednesday, May 6, 2009
How to create your own local path
Tuesday, May 5, 2009
MOSS & AJAX (Framework 3.5)
- Before u run it backup your web.config and your DB and do not delete the element by your self only with the remove file.
- Don't copy the remove and the add together to the Config directory only the one you want to run.
- Very important don't change the guid before you are doing remove!!!
Wednesday, March 11, 2009
MOSS Search PDF 64-bit using IFilter 9
Install the PDF Ifilter 9 for 64-bit
- Download and extract the contents of "PDFiFilter64installer.zip" to your local drive.
- Double click "PDFFilter64installer.msi" to launch the installer.
- Follow the instructions in the installer wizard to complete the installation.
- After installing the PDF iFilter, it is recommended that you set your system PATH environment variable to the "bin" folder of the "Ifilter" installation. For example, from the "Control Panel\System\Advanced\Environment Variables" tab, append to PATH "C:\Program Files\Adobe\Adobe PDF iFilter 9 for 64-bit platforms\bin\" and then restart the computer.
- Follow the Sharepoint IFilter Configuration Guide
Add the PDF extension to Search File Types
- SharePoint Server Search Administration page by adding ‘pdf’ to list of File Types in Search Administration->File Types
Add the PDF File Icon to MOSS
Restart all SharePoint services as well as IIS.
- Run these command-lines:
“net stop osearch”. Wait for success message.
“net start osearch”. Wait for success message. - Restart IIS using iisreset command line and wait for success message.
Re-Crawl
Make sure that you Full Crawl !!!
*** Troubleshooting ***
Important step that will solve this error message "The filtering process could not process this item. This might be because you do not have the latest file filter for this type of item. Install the corresponding filter and retry your crawl."
Make sure to change the \\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office Server\12.0\Search\Setup\ContentIndexCommon\Filters\Extension\.pdf to the GUID {E8978DA6-047F-4E3D-9C78-CDBE46041603}. The original value was {4C904448-74A9-11D0-AF6E-00C04FD8DC02}. (thanks to Russell Wright for that one)
URLs:
http://download.adobe.com/pub/adobe/acrobat/win/9.x/PDFiFilter64installer.zip
http://www.adobe.com/support/downloads/detail.jsp?ftpID=4025
http://support.microsoft.com/default.aspx/kb/832809
http://www.adobe.com/special/acrobat/configuring_pdf_ifilter_for_ms_sharepoint_2007.pdf
http://www.adobe.com/images/pdficon_small.gif
http://sharepointsolutions.blogspot.com/2009/01/installing-adobes-64-bit-pdf-ifilter-9.html
How to easy add Dll to the gac
1. Foreach .NET version paste the apropriate script in a new file
2. Save it with ".reg" extension
3. Double click on each file to add the entry in the registery.
.Net 1.1
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\dllfile\shell\gacutil\command]@="c:\\windows\\Microsoft.NET\\Framework\\v1.1.4322\\gacutil.exe /i \"%1\""
.Net 2.0
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\dllfile\shell\gacutil\command]@="C:\\Program Files\\Microsoft Visual Studio 8\\SDK\\V2.0\\Bin\\gacutil.exe /i \"%1\""
Thanks to Elad R...
Tuesday, March 10, 2009
New Release Content Type List Binder
Saturday, March 7, 2009
SPQuery syntax
- SPQuery.Query:
- SPQuery.RowLimit: An int that indicate the row limit.
- SPQuery.Folder: Get a SPFolder object.
This is the best way to get items that are in folder.
- SPQuery.ViewField: The same is a "SELECT" sentence.
- AND:
- OR:
- AND & OR:
If your farm is well indexed, retiewing datas using SPquey in the best method to improve performance. See also our post about working with large list in Sharepoint