Can't enable Microsoft.Security.Application?

I can not enable Microsoft.Security.Application

using Microsoft.Security.Application; 

Gives this error:

The type or name of the Security namespace does not exist in the Microsoft namespace (are you missing the assembly reference?)

And yes, I clicked on Bin → Add Link ... → AntiXSSLibrary.dll and added it to the Bin folder, including AntiXSSLibray.xml.

I rebuilt the whole site and still nothing.

I am using ASP.NET 3.5 C # - AntiXSSLibrary 4.0 Stable

+8
c # namespaces antixsslibrary
source share
6 answers

Right mouse on your website → Convert to web application. See: How to Convert an ASP.NET Web Site to an ASP.NET Web Application

+2
source share

If you get this nuget, all extension objects will be visibles

Install-Package AntiXSS

he solves my problem.

html = Microsoft.Security.Application.Encoder.HtmlEncode(model.SiteName), model = Microsoft.Security.Application.Encoder.HtmlEncode(json),

+17
source share

If, like me, you use AntiXSSLibrary in the class library via Nuget and get the above error:

  • Remove any external links you had with Nuget
  • Delete the Nuget package file located in packages.config found in the solution root directory
  • Delete the packages directory - again in the solution root directory
  • Reinstall all of your components.
+2
source share

Uninstall and reinstall AntiXSS:

Tools -> NuGet Package Manager -> Package Manager Console (user interface may be different when using other than Visual Studio 2013):

 Uninstall-Package AntiXSS Install-Package AntiXSS 

For multi-project solutions, be sure to set the default project depending on what the problem is. Use Uninstall-Package -Force AntiXSS if the uninstallation fails, and if you can handle any package dependency problems that may occur, although I do not know any of these packages.

+2
source share

The answer here helped me. I found the AntiXssLibrary.dll file in the bin folder of my site.

+1
source share

You are using using Microsoft.Security.Application;

Try this using System.Web.Security.Application;

For me it was the other way around. I think this is due to the different versions of my AntiXSSScripting DLL that I use.

0
source share

All Articles