Friday, November 5, 2010
Operation is not valid due to the current state of the object when making changes to SPListItem object using elevated previliges
Make changes to SPListItem using elevated privileges
I am really surprised by seeing the code in his article. It is completely unexpected and it is working great. I am really not believed when I saw the code very first time, but it is working.
But, make sure you are disposing the objects correct. Hope this will help you too to fix the problem "Operation is not valid due to the current state of the object".
Tuesday, May 4, 2010
UserProfileServiceUserStatisticsWebPart:LoadControl failed - SharePoint 2010 Exception
But, we have an excellent resource to solve all these issues. I mean SharePoint Log files. When I went there and looked into the file, I found below exception message.
Wednesday, February 24, 2010
Retrieving the COM class factory for component with CLSID {BDEADF26-C265-11D0-BCED-00A0C90AB50F} failed due to the following error: 800703fa
Retrieving the COM class factory for component with CLSID {BDEADF26-C265-11D0-BCED-00A0C90AB50F} failed due to the following error: 800703fa.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Runtime.InteropServices.COMException: Retrieving the COM class factory for component with CLSID {BDEADF26-C265-11D0-BCED-00A0C90AB50F} failed due to the following error: 800703fa.
Workaround:
- Doing an IISRESET solving the problem but it is solving temporarily.
- Open IIS and go to your SharePoint site. And find the application pool.
- Go to application pool, click Advanced settings, change the value for "Load User Profile" to "true".
Special thanks to Bassem Georgi for the nice tip.
Monday, February 15, 2010
SharePoint Exception: No item exists [url]. It may have been deleted or renamed by another user.
More details about exception:
No item exists at http://mysharepointsite/Pages/Home.aspx?id=4&q=HQ. It may have been deleted or renamed by another user.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: Microsoft.SharePoint.SPException: No item exists at http://mysharepointsite/Pages/Home.aspx?id=4&q=HQ. It may have been deleted or renamed by another user.
SharePoint Exception: Coercion Failed: Input cannot be null for this coercion
The problem occurs only when the source choice field is empty.
More clearly, I have a list with checkbox list field. When a new list item is added, the workflow triggers and start updating the another list item with the current item information. And when I select nothing in the checkbox list field, then it throws the exception "SharePoint Exception: Coercion Failed: Input cannot be null for this coercion".
So, why the problem comes?
Because in update list item phrase in SharePoint designer I have selected the lookup for choice Return field as as Choices, Comma delimited. See the below screenshot.
Once changed that back to the As String then everything worked perfect. But, didn't get the reason behind. When nothing selected, then it shouldn't do any operation. It should check for null and do nothing. May be a built-in problem or something interesting with this.
Hope this helps to understand it well and solve your problem.
Friday, February 12, 2010
Declarative workflows cannot automatically start if the triggering action was performed by System Account
After some research found that, when we are using system account [With the account we installed SharePoint], the workflows won't run automatically. This is looking crazy but that is what the problem. When I try to run them manually, then they are running absolutely fine, but they aren't starting automatically.
When I try to login with another account other than system account, no problems. Workflow starts automatically. The only reason is "if we install SP1 package, then declarative workflows can no longer be triggered by the SharePoint System account" as there is the possibility of security vulnerability. So, they didn't give access to run the declarative workflows under the System account.
So, friends, if you face any type of these problems make sure you login with some other account other than system account. Hope this helps to save at least 2-3 hours of time.
Sunday, December 27, 2009
Request format is unrecognized for URL unexpectedly ending in methodname
This is the exception I am getting when I try to access web services from my web site. I just created a web service and tried to access the service from the browser using the get request. But I got the invalid operation exception. See complete exception details below:
System.InvalidOperationException: Request format is unrecognized for URL unexpectedly ending in '/MethodName'
So, Before we will go to know the solution for it, I want to explain the reason behind this.
A .NET web service supports three protocols named HTTPGET, HTTPPOST and SOAP. When .NET released I mean, ASP.NET v1.0 all these three protocols enabled by default. So, any requests which made from the browser which belongs to a web service will be responded without any issues. But when come to ASP.NET 1.1 version the protocols HTTPGET and HTTPPOST are disabled by default. The only reason is SECURITY issue. So until you explicitly enable them no web service request will be processed if you call them in the format domain/webservice.asmx/methodname [Get/Post].
But, where as if you call direct web service from browser using SOAP request that will work and will give result what you need. But, if you make any GET or POST request then only the problem will come.
RESOLUTION:
To enable these protocols in the application level simply we need to change the application config file. Web.config. Add below lines to the web.config to enable these protocols.
So, this webservices tag will go inside the <system.web> namespace. With the above lines, the protocols enabled and they listen the request and respond accordingly for that application. Sometimes you may need to enable these protocols in system level. I mean to all applications in the server should have these protocols enabled. Then below is the solution for it.
Find machine.config file and open it in nice editor like visual studio. Before do any changes please take a backup of the file. Now find the protocols section and add the below lines if they are not already there.
Hope, you understood it well and you are now knew the reason behind of the above exception message. Please know me the feedback.
Friday, December 11, 2009
Could not load type Microsoft.TeamFoundation.WorkItemTracking.Client.workItemTypeDeniedOrNotExistException
This is the exception we are getting when we try to view the workitems from the Team explorer in visual studio. The problem is, you installed the team explorer after you installed the Visual studio 2008 SP1. Because of this, all the workitem related dll’s are not referenced correctly. And result is below exception message.
Resolution:
To fix this issue, we just need to reinstall the visual studio sp1. So, the order should be
- Visual Studio
- Team Explorer
- Visual Studio SP1
Hope this helps to the people who are facing the same issue.
