SharePoint

Using SharePoint client object model

SharePoint 2010 has powerful client object model that you can use to write external applications that use SharePoint data. In this posting I will show you how to get data from lists using client object model and how to optimize queries to save some bandwidth.

10 interactive SharePoint 2010 labs by Microsoft

Microsoft has published some simple and nice interactive labs under title Build a better app that help you to get started with SharePoint 2010 development on Visual Studio 2010. Each lab should take about 15 minutes of your valuable time.

Unable to locate the xml-definition for CType with SPContentTypeId

When deploying your SharePoint solution to your development or test server where solution has been deployed before you may find errors like these in SharePoint log:Unable to locate the xml-definition for CType with SPContentTypeId and Failed to find the content type schema for ct-0-0x010100 during template lookup.

Session state can only be used when enableSessionState is set to true, either in a configuration file or in the Page directive

When IIS is not configured properly after creating SharePoint application and there are web parts or features that use session you may get the following error: Unexpected error occured: System.Web.HttpException: Session state can only be used when enableSessionState is set to true, either in a configuration file or in the Page directive. Please also make […]

Failed to get value of the "Approval Status" column from the "Moderation Status" field type control

When upgrading site from SharePoint 2007 to SharePoint 2010 or if somebody has tried to be extreme smart-ass you may get the following error when saving item or document to list where content approval is turned on: Failed to get value of the “Approval Status” column from the “Moderation Status” field type control. See details in log. Exception message: Input string was not in a correct format.

Cannot use SharePoint 2010 API from console application

Suppose you create new console application using Visual Studio 2010 and add reference to SharePoint 2010 main library. When you run application you get the following error: Retrieving the COM class factory for component with CLSID {BDEADF26-C265-11D0-BCED-00A0C90AB50F} failed due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)). Same error may […]

Debugging SecurityTokenServiceApplication

SharePoint 2010 security token service application is not in debug mode by default and doesn’t expose any problems out from service. This makes ULS logs practically unusable because they give you no idea about problems in token service. To get information running you need to turn on exception details. Here is how to do it.

Could not find any resources appropriate for the specified culture (or the neutral culture) on disk

When you are building site definitions with localization support you may get the following error when creating new site: Provisioning did not succeed. Details: The site template was not provisioned successfully. Delete this site collection in Central Administration, and then create a new site collection. OriginalException: Could not find any resources appropriate for the specified culture (or the neutral culture) on disk.

List instance data is deployed asynchronously

Suppose you have SharePoint list instance that is deployed to site using feature. Also suppose this list instance has event receiver bound to it. Add some debug messages to event receiver, run your project and activate feature through SharePoint web interface. From output you should see that items are added to list on more than […]

The program w3wp.exe, with the assigned process ID, could not authenticate locally by using the target name HTTP/WEBSITENAME.

You may face this error when you are running your development environment on virtual server where you have also configured alternate access URL-s.The full message is something like this: “The program w3wp.exe, with the assigned process ID, could not authenticate locally by using the target name HTTP/WEBSITENAME. The target name used is not valid. A target name should refer to one of the local computer names, for example, the DNS host name. Try a different target name.”

Could not load file or assembly CabLib or one of its dependencies

When using WSPBuilder from command line you may get the following error: “Could not load file or assembly ‘CabLib, Version=10.2.0.0, Culture=neutral, PublicKeyToken=5c838b77b53f84a0’ or one of its dependencies. An attempt was made toload a program with an incorrect format.” This error occurs if there is something wrong with CabLib.dll or if CabLib.dll doesn’t exist in same folder with WSPBuilder.

Web Part Error: A Web Part or Web Form Control on this Page cannot be displayed or imported. You don’t have Add and Customize Pages permissions required to perform this action.

After deploying your solution to SharePoint anonymous and read-only users may get the following error: Web Part Error: A Web Part or Web Form Control on this Page cannot be displayed or imported. You don’t have Add and Customize Pages permissions required to perform this action. Well, this is the case that is solved by famous this-issue-is-by-design (read: you have to find your own way how to solve the problem).

Add-SPShellAdmin–user cannot exist in database

If you try to add user to SharePoint shell administrator role you may get the following error: “Cannot add to the SharePoint_Shell_Access role of the database SharePoint_Config_. A possible cause of this error is that the account name was already added to the database as a login using a different user name than the account name.”

Getting access to database installed by SharePoint 2010 single server install

After performing single server installation of SharePoint 2010 you have new SQL Server instance called SHAREPOINT running on your server. You can access it using Management Studio but you cannot do practically nothing with this instance if you are logged in as domain user to this machine. You have to add your domain account to server admin role so you can manage this SQL Server.

Previous Posts Next posts