3

I have added the Sample .NET spam filter implementation code inside the class in "App_Code" folder

I have also updated the web.config file with below keys.

Comment.SpamFilter.Assembly
Comment.SpamFilter.Implementation
Comment.SpamFilter.Exclude1

I am able to submit/ view the Comments when I remove the above keys from web.config file.

Please suggest.

<add key="Comment.SpamFilter.Assembly" value="namespace name" />
<add key="Comment.SpamFilter.Implementation" value="namespace name.WordsSpamFilter" />
<add key="Comment.SpamFilter.Exclude1" value="poker" />

[ArgumentNullException: Value cannot be null.
Parameter name: type]
   Tridion.ContentDelivery.UGC.Web.Utilities.UGCConfigurationLoader..ctor() +293
   Tridion.ContentDelivery.UGC.Web.Utilities.UGCConfigurationLoader..cctor() +28

[TypeInitializationException: The type initializer for 'Tridion.ContentDelivery.UGC.Web.Utilities.UGCConfigurationLoader' threw an exception.]
   Tridion.ContentDelivery.UGC.WebService.WebServiceHelper.PostComment(String itemUri, String username, String email, String content) +422
   Tridion.ContentDelivery.UGC.Web.UI.ManageComments.Render(HtmlTextWriter writer) +505
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +246
   System.Web.UI.HtmlControls.HtmlForm.RenderChildren(HtmlTextWriter writer) +315
   System.Web.UI.HtmlControls.HtmlContainerControl.Render(HtmlTextWriter writer) +48
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +246
   System.Web.UI.Page.Render(HtmlTextWriter writer) +40
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5274
  • Given that the error is thrown by UGCConfigurationLoader it would be helpful to post the sections you added to web.config - it does seem to be related to it. – Nuno Linhares Apr 2 '13 at 11:00
  • Updated the question with config enteries – Meenakshi Apr 2 '13 at 12:21
  • 1
    Can you compile your code and put it inside a DLL? That DLL should in turn be added to the bin folder. – Daniel Neagu Apr 2 '13 at 14:16
  • I have already compiled it and respective dll is in bin folder. I have created App_Code folder in my solution where I have inserted the spam filter code in a class. Then I have build my project and put the dll in the bin folder but after inserting above keys in the web.config I get the above error. Thanks – Meenakshi Apr 2 '13 at 14:35
  • @Meenakshi have you come to a solution for this issue? Maybe you can provide an update with either the solution or more information so we can close this question with a valid answer? In reading through your question again, I could come up with this one btw. maybe it is of some help? serverfault.com/questions/393721/… – Bart Koopman May 15 '13 at 11:44
2

I added the class called "WordsSpamFilter" which inherits the SpamFilter class in App_Code folder.

The issue resolved when I change the "Build Action" property of my class from "Content" to "Compile".

Thanks Meenakshi

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.