MOSS Forum

Ask Question   UnAnswered
Home » Forum » MOSS       RSS Feeds

Central Admin Web object and SPDiagnosticsServiceBase

  Date: Oct 13    Category: MOSS    Views: 990

It may not have have anyting to do with the SPDiagnosticsServiceBase,
but I am putting entire scenario here for clarity.

I want to create a Custom Logger using SPDiagnosticsServiceBase class. I
also want to store the "Categories" in a custom list, so that the
categories are not hard coded and adding, removing category just require
re-registering the service.

I created the list, added few items in it and register the service using
a Feature Receiver. My Area and Categories start appearing on the
diagnostic settings page and every thing looked great till here.

Now when I change the logging level for my Custom Area, the diagnostic
settings page crashed.

I was trying to access category list from ProvideAreas() method. I found
out that the SPWeb object reference to Central Administration site has
some funky behaviour. Alot of properties of SPWeb throws an exception
(even AllowunsafeUpdates). However these properties were available for
the Web reference obtained from SPFeatureReceiverProperties.Parent.

When I try to access the list using web.Lists.tryGetList("Category") it
does return me a reference, but accessing list items using
categoryList.Items throws an exception, however list.ItemsCount is
correctly shown.

I appreciate if anyone point me to a blog or something where I can know
more about the SPWeb reference for Central Admin site or guide me to a
better implementation of what I am trying to accomplish? I am willing to
share the code.



No Answers Found. Be the First, To Post Answer.

Didn't find what you were looking for? Find more on Central Admin Web object and SPDiagnosticsServiceBase Or get search suggestion and latest updates.