dinsdag 20 april 2010

"The filename or extension is too long." when accessing MOSS CrawlRules FIX



Error when accessing the crawl rules with the SharePoint API:

Unhandled Exception: System.IO.PathTooLongException: The filename or extension is too long.
at Microsoft.Office.Server.Search.Administration.SearchApi.RunOnServer[T](CodeToRun`1 remoteCode, CodeToRun`1 localCode, Boolean useCurrentSecurityContext, Int32 versionIn)
at Microsoft.Office.Server.Search.Administration.SearchApi.RunOnServer[T](CodeToRun`1 remoteCode, CodeToRun`1 localCode, Int32 versionIn)
at Microsoft.Office.Server.Search.Administration.SearchApi.GetCrawlRuleList(Int32 versionIn)
at Microsoft.Office.Server.Search.Administration.CrawlRuleCollection..ctor(Content parent)
at Microsoft.Office.Server.Search.Administration.Content.get_CrawlRules()


You can fix this error by deleting the crawl rule from the registry. Check the following registry key
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office Server\12.0\Search\Applications\90604ba8-1a0b-448d-87b6-9b5c04a69c9b\Gather\Portal_Content\Sites\*\Paths\0

and delete it.
After a reboot the crawl rules are accessible again.

Arnold thanks 4 the tip.

maandag 22 maart 2010

MOSS - Could not load file or assembly 'cablib' or one of its dependencies. An attempt was made to load a program with an incorrect format.

When doing a upgrade of some WSP packages on a acceptation server I encountered the following error on several MOSS sites hosted in this machine:

Could not load file or assembly 'cablib' or one of its dependencies. An attempt was made to load a program with an incorrect format.

This did not happen on the dev or test environment, so what is happening here? I found out that cablib.dll was accidentally included in the WSP package. The WSP wad targeting the BIN directory of several SharePoint webapps. (We use WSP builder to create our WSP packages.) Cablib.dll is compiled for 32-bit only, when adding this dll to the bin directory of a 64 bit ASP.Net application, asp.net dies quickly. This did not cause a problem for our dev and test environment because they are 32-bit machines!

The fix was simple, clean your output directories to remove the cablib.dll from your WSP package and upgrade the WSP.