Friday, 27 August 2010

MissingSetupFile for themes

Running Test-SPContentDatabase for migration preparation. The report contained errors referring to missing themes files. The web didn´t use the theme as the active theme but had used the theme before.

Start SPD and open the site. Browse to the themes folder and delete the theme folder referenced in "MissingSetupFiles". Open the web in the browser and delete the folder from the Recycle Bin and then also from the site collection Recycle Bin.

Tuesday, 6 July 2010

Unexpected error creating debug information file

In several of my SharePoint projects I'm using a WinForm application to test and trigger SP code.

Sometimes I have had big problems when recompiling the SP projects and generating the PDB file. This time I disabled the VSHOST option for my WinForm project and the problem was solved.

VS spawns a new winformexe.vshost.exe process each time I tried to kill it with Process Explorer, so it kept me from recompiling the other SP corrctly.

How to: Disable the Hosting Process

Monday, 10 May 2010

WSPBuilder and VB.Net

Developing a solution for a client which want´s the sourcecode in VB.Net (It took some hours before I stopped using ";" and "{}" ;) ).

A known fix for getting all ASP.Net items available in a WSPBuilder project is to amend the .csproj file with a ProjectTypeGuids element. The same goes for VB.Net but the element that needs to be added is different:

{349c5851-65df-11da-9384-00065b846f21};{F184B08F-C81C-45F6-A57F-5ABD9991F28F}

Wednesday, 28 April 2010

WebTemplate

Have noticed a long awaited feature in SP2010: WebTemplate! This means that you can add a template definition for one site collection only and not for the whole farm.

Monday, 26 April 2010

MCPD!

Passed the last certification and got the rewarded the MCPD credential. Actually the first title since my MCSE for Windows Server 2000. Have only been taking subject specific certificats since then, mostly SharePoint ofcourse.

Wednesday, 21 April 2010

jQuery and the find selector

When working with XML in jQuery a selector called $find can be used to find elements in the XML object that is loaded. I had a problem with IE7 and a webservice returning XML. The problem was that IE 7 didn´t recognize the returning XML as an [object] but rather as a string. Adding a dataType attribute to AJAX method solved the problem.

Solution reference: http://www.gammageek.com/2008/10/jquery-xml-in-ie.html

Wednesday, 24 February 2010

Enable debugging for _layouts files

I wanted to see the ASP.net error for files in a subdirectory to _layouts folder. So I created a web.config in the subfolder with this content:


<configuration>
<sharepoint>
<safemode maxcontrols="200" callstack="true" directfiledependencies="10" totalfiledependencies="50" allowpageleveltrace="false">
<pageparserpaths>
</pageparserpaths>
</safemode>
</sharepoint>
<system.web>
<compilation batch="false" batchtimeout="600" maxbatchsize="10000" maxbatchgeneratedfilesize="10000">
<httphandlers>
<add type="System.Web.UI.PageHandlerFactory, System.Web, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" path="*.aspx" verb="*">
</httphandlers>
<customerrors mode="Off">
</SYSTEM.WEB>
</configuration>

Save the file and your ASP.Net error messages will appear.

Friday, 4 December 2009

Push changes from a content hub

1. Change or add a content type in a content hub site.
2. Click on "Manage Publishing for this content type" in the content type administration page.
3.Click on "Publish" if it´s a new content type or "Republish" if it´s a content type update.
4. Fire up "SharePoint 2010 Management Shell" on the SharePoint server.
5. Run these commands to trigger the timer jobs for content hub sync:

Start-SPTimerJob MetadataHubTimerJob
Start-SPTimerJob MetadataSubscriberTimerJob

6. Check your "Job History" (Monitoring --> Check job status --> Job History) page in CA for the status of the timer jobs

Sunday, 29 November 2009

Updatelistitems and 0x8007000

Using the UpdateListItems webservice from jQuery creating an item in a custom list returned the error: "0x80070005 The operation failed because an unexpected error occurred. (Result Code: 0x80070005)".

The webservice call worked correctly for site collection admin and site admins but not for ordinary users. The list was configurd with "Add item" and "View pages" permissons for ordinary users which should provide correct access for the UpdateListItem method.

The problem with the list was that is was configured with a "None" value for the property "Edit access" (General settings --> Advanced settings). After changing it to "Only their own" the method call succeeded. So the "Edit items" property was messing up a "New item" method call.

Updatelistitems and 0x8007000

Using the UpdateListItems webservice from jQuery creating an item in a custom list returned the error: "0x80070005 The operation failed because an unexpected error occurred. (Result Code: 0x80070005)".


The webservice call worked correctly for site collection admin and site admins but not for ordinary users. The list was configurd with "Add item" and "View pages" permissons for ordinary users which should provide correct access for the UpdateListItem method.


The problem with the list was that is was configured with a "None" value for the property "Edit access" (General settings --> Advanced settings). After changing it to "Only their own" the method call succeeded. So the "Edit items" property was messing up a "New item" method call.

Thursday, 26 November 2009

OT: Copy contacts between C905 and Satio

Switched telephone to a Satio yesterday :). But had some trouble to get my PIM information to come along. I´m running the Office 2010 beta so PC Suite from SEMC didn´t recognize it, the otherwise excellent MyPhoneExplorer could only move SMS and bookmarks between the phones. The solution was to use the Synchronization service from SEMC (still in beta). It worked perfect and now I also have the possibility to schedule an online backup directly from my phone.

Friday, 20 November 2009

Move My Site web application in MOSS 2007

We had a situation where a brand new web application needed a new host header and be moved from a high port to port 80.

Use this guide to add a host header.

Make sure you use the Default zone (or else you can not browse to 'Advanced Permissions' or add web parts).

Update "My Site" settings in the SSP

Recrawl the content source which index the user profile database, or else you will not be able to search for users.

Fix Hyper-V VHD for Virtual Box 3.0.10

I downloaded the Windows 2008 x64 VHD from Microsoft with the purpose to mount it in Virtual Box. When the virtual machine started the following error message was displayed: "Fatal no bootable medium found system halted".

The solution was to download VPC 2007 and run the Disk Wizard and compact the VHD (as stated here).

Thursday, 12 November 2009

This Page has been modified since you opened it. You must open the page again


A lot of suggestions how to solve this:
- Add a "PublishingPageLayout" to the elements.xml file.
-Inherit from TemplateRedirectionPage instead of PublishingLayoutPage in the page layout file.
- MSO_PageHashCode is not cleared for detached pages.

None of the above had anything to do with my problem.

In my case it was two problems that throw the same error. I had one event receiver attached to a Pages library that did a call to "RunWithElevatedPrivileges" and did a SPListItem.Update() which caused the page to display the error message. I updated the event receiver according to this article, using the SPUserToken instead.

The other problem was that I had created a page with SharePoint Designer by right-clicking a Page Layout in masterpage and then choosing "New from Existing Page". This created the page but associated it with the wrong content type. Use SharePoint Manager 2007 and you will see that it attached the "Page" content type. Instead I used the web interface to create a new page and checked the content type which now was using "Welcome Page".

This leads me to the conclusion that the articles stating that you need to add a property "PublishingPageLayout" to your elements.xml files when provising (ex: create and upload files during feature activation) files are correct. But in my case I created a new page the wrong way (using SPD and not the web interface).

Friday, 23 October 2009

Failed to create feature receiver object from assembly

Remember that the class that inherits from SPFeatureReceiver need to be "Public"

Thursday, 8 October 2009

User Profile Import stuck on "Enumerating"

I keep an eye on some of our clients SharePoint farms and today I came across an error in the profile import for one of the SSPs. “The user profile database connection cannot be made, because of error 0x80004005” is displayed on the “User Profiles and Properties” page and the “Profile import status” was only displaying “Enumerating”.

The import cannot be stopped, if the server is restarted then the error doesn´t disappear according to several posts in newsgroups.

So what to do? I checked and double-checked the SSP database and the values in the Profile_Stats, MIPObjects and MIPScheduleJob tables which all had values related to the Profile Import. But nothing that I did could solve the problem.

But then I remembered that the crawler application is based on the good old Indexing Service which means that the registry is also used to store settings. So after some digging I found the solution by changing a value in the registry for the crawler.

Open the registry editor. Browse to “HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office Server\12.0\Search\Applications”. Here you will find a key for each SSP in the farm. Drill down to "\Gather\ProfileImport\ContentSources\0" (which is the Full Import) and check the key “CrawlNumberInProgress”. If it´s not “0xffffffff” then the number displayed corresponds to a key under the branch “HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office Server\12.0\Search\Applications\\Gather\ProfileImport\Crawls”.

I changed the number in the key “CrawlNumberInProgress” to “0xffffffff” and then restarted the “Office SharePoint Server Search” service for the settings to be applied.

The error message disappeared from “User Profiles and Properties” and I could start a new full import to the “User Profile Import”

Disclaimer: remember to backup your registry before making any changes. I am not responsible for your system damages because of any registry errors

Monday, 5 October 2009

Saturday, 26 September 2009

Lifecycle problem with WSPBuilder and EditorPart

I had a problem with the ApplyChanges method in an EditorPart class that was used in a WSPBuilder WebPart class (the default web part that WSPBuilder creates). The CreateChildControls in the WebPart class was triggered before the ApplyChanges method in the EditorPart class. Therefore the web part content was not updated and the page had to be reloaded to show any update to the web part.

In the WebPart class that is created from WSPBuilder the CreateChildControls is triggered from the OnInit method. This has the consequence that the ApplyChanges method in the EditorPart class will be triggered after the CreateChildControls in the WebPart class. My solution was to remove the method call in OnInit and then the ApplyChanges method was firing correctly.

Saturday, 29 August 2009

The project location is not trusted and a zip file

When opening an unzipped Visual Studio project I got prompted with "The project location is not trusted". The problem was that the zip file was downloaded from an untrusted location and I needed to unblock it first. Right-click on the zip file --> Properties and the click on "Unblock"

Thursday, 2 July 2009

SPListItemVersion and Dates

It seems SPListItemVersion objects are not displaying dates in the correct timezone. I had to convert the date to a DateTime object and the use the ToLocalTime method to get the correct date out.