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.