locked
AntiXss does not exist RRS feed

  • Question

  • User-173333858 posted

    Hi, 

    My asp page has this:

    using System.Web.Security.AntiXss.

    I have installed AntiXss Nuget package, and made sure the bin folder lists the AntiXss.dll file. The project on building still keeps giving me this error:

    error CS0234: The type or namespace name 'AntiXss' does not exist in the namespace 'System.Web.Security' (are you missing an assembly reference?)

    is there some thing I am missing here?

    -Rashmi

    Monday, November 18, 2019 8:26 PM

All replies

  • User61956409 posted

    Hi Rashmi,

    error CS0234: The type or namespace name 'AntiXss' does not exist in the namespace 'System.Web.Security' (are you missing an assembly reference?)

    Please check if you have added reference to 'System.Web.dll' in your project.

    With Regards,

    Fei Han

    Tuesday, November 19, 2019 1:59 AM
  • User-173333858 posted

    Hi Fei Han,

    I have this in my code behind page (aspx.cs):

    using System.Web;

    When I try adding it as a reference, it says, the program is already referencing System.Web, mostly because of my above statement. I have tried everything there is to try. My asp project is a web- site, not a project. What else could I be missing?

    -Rashmi

    Tuesday, November 19, 2019 6:19 PM
  • User61956409 posted

    Hi Rashmi,

    RDesh

    When I try adding it as a reference, it says, the program is already referencing System.Web, mostly because of my above statement. I have tried everything there is to try. My asp project is a web- site, not a project. What else could I be missing?

    If your website application built on .Net Framework 4.0 and earlier versions, the error "The type or namespace name 'AntiXss' does not exist in the namespace 'System.Web.Security'" would occur. 

    Note: it would work well on project with .Net Framework 4.5 and above.

    With Regards,

    Fei Han

    Wednesday, November 20, 2019 6:50 AM
  • User-173333858 posted
    Hi Fei Han,

    So, I know the website was built on an older version of visual studio on target framework 4.0. What would be better, changing the target framework in my newer VS version to 4.0 or building the website in the older VS version?
    Rashmi
    Wednesday, November 20, 2019 11:05 AM
  • User61956409 posted

    Hi Rashmi,

    You can try to change the target framework to 4.5 or higher, then rebuild the project and check if it can help fix the issue.

    With Regards,

    Fei Han

    Thursday, November 21, 2019 5:49 AM