SecurityException when running protocol handler

Nov 21, 2008 at 9:49 AM
Hi there,

I have downloaded the sample from this page and compiled it, but when trying to use it I run into some problem. When I add a System.Diagnostics.Debugger.Break();   at the Init of protocolhandler.cs it gets me into debug mode and it runs fine until I arrive at PerformanceCounterCategory.Create(PERF_CATEGORY, "MOSSPH Protocol Handler", PerformanceCounterCategoryType.SingleInstance, counters); . At that point it gives me a A first chance exception of type 'System.Security.SecurityException' occurred in  mscorlib.dll error msg. I am running it from the local machine's HD and the my computer zone has full trust. Anyone have any idea what is wrong here?
Nov 21, 2008 at 2:16 PM
In order to create the entries for the performance counter, your app needs to write to the registry.  It will use the default content access account to do this (since this is the identity of your protocol handler).  If this user doesn't have the required access it throws this error.

Since this will only be done once you're probably better off creating the counters in an install/config application.  This would also be a good place to create any crawled/managed properties, etc...
Nov 21, 2008 at 2:37 PM
Ah thanks alot! Works like a charm ^^
Dec 8, 2008 at 3:21 PM
I tried to use the sample code and modify it to crawl my custom format which I call vfs. The PH gets initialized fine and I can see logs printing from the init method. But no other method is being called. I added a crawl rule vfs://* in the search settings for the Sahred Services. But in event logs I get a warning saying:
In the content source the start address is of the form : vfs://server/content.vfs

The specified address was excluded from the index. The crawl rules may have to be modified to include this address. (0x80040d07)

I'd be grateful if you can give any clue if you happen to know something in this regard.

Thank you very much.

Dec 8, 2008 at 3:38 PM
Hmm ,
I am not using any crawl rules to crawl as I am just using the default access account.
That works for me, maybe you can try just making a crawl rule for the vfs://server/content.vfs?
Although it seems its only suited for paths, maybe try vfs://server/*?

Since I didn't have to use it I have no idea though... Sorry...