2

In my ASP.NET WebApplication I have the following entry in my web.config:

<pages controlRenderingCompatibilityVersion="3.5" clientIDMode="Static">
    <namespaces>
        <add namespace="XSS=Microsoft.Security.Application" />
    </namespaces>
</pages>

This enables me to use the AntiXSS-Library within my Pages and Controls in an easy and short way without using the fully qualified namespace every time, like this:

<%# XSS.Encoder.HtmlEncode(Eval("something").ToString()) %>

instead of

<%# Microsoft.Security.Application.Encoder.HtmlEncode(Eval("Branche_lbl").ToString()) %>

This works perfectly in ASP.NET, unfortunately Resharper seems to be unable to resolve the alias, marks the line as error and says

Cannot resolve symbol: XSS

Is there a way to solve this problem?

2 Answers 2

2

It's seems like a hack of ASP.NET and not documented... We'll think about fix in R# 7.0

Sign up to request clarification or add additional context in comments.

Comments

0

If it compiles fine and works, you could just have Resharper ignore it by going into the "Inspection Options".

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.