Bare essentials - solution code

Apr 19, 2011 at 9:14 PM
Edited Apr 19, 2011 at 9:15 PM

I had a similar problem with attempting to use the precompiled versions of the AntiXssLibrary dlls; since there is zero documentation and no explanation, I simply assumed the following:

1)  When working with code in a page or control and NOT in the .cs code-behind, I used the Import directive and assigned the Namespace to Microsoft.Security.Application.

2)  I could then call the AntiXss object within my aspx, as in the following:

<asp:Label ID="lblFileSize" Text='<%# AntiXss.HtmlAttributeEncode(DataBinder.Eval(Container.DataItem, "ContentSize").ToString()) %>' runat="server" />

However, this use BROKE MY APPLICATION.

Therefore, I downloaded the solution code, believing that compiling the DLL into my solution would be far more elegant and sensible.

However, there appears to be entirely too much stuff in the solution code, including references to tools I don't and WON'T use (StyleCop?).  Is there any way to pare down the solution to its bare essentials for those of us trying to use it in a real environment?  And perhaps some serious documentation on how to use it or how to compile it within another solution?

Apr 19, 2011 at 9:50 PM

Hmm, weird, I thought I'd stripped out the StyleCop bits when I published last. There will probably be an updated encoder push within the next few weeks (beta bits, compile it up and try it type scenario) - I'll make sure the stylecop bits aren't there any more.

I must admit I'd not thought of using it within the page as a use scenario, as it's reasonably rare, so I'll add that to the documentation to-do list. What else would you like to see in the CHM documentation?

Apr 21, 2011 at 3:50 PM

Any notes on compiling the library source as a project under another solution would be very helpful.  My objective will be to utilize the compiled library as a referenced internal project; so, it would help to know if there are any special requirements in order to do so..

Apr 21, 2011 at 4:15 PM

There shouldn't be any requirements at all, just Add Existing Project and away you go.

Apr 25, 2011 at 1:58 PM

I pushed a beta this weekend of the AntiXSS library, and have hopefully stripped all the stuff I use internally to ensure style and quality - please give it a shot, and let me know if I've left anything behind.