Adding ASP.NET MVC5 Identity Authentication to an existing project

I have seen lots of similar pages on the web, but most of them use a new project instead of an existing one, or don’t have the necessary features. So, I have an existing MVC 5 project and want to integrate ASP.NET MVC5 Identity with log in, email confirmation and password reset features. In addition … Read more

include antiforgerytoken in ajax post ASP.NET MVC

I am having trouble with the AntiForgeryToken with ajax. I’m using ASP.NET MVC 3. I tried the solution in jQuery Ajax calls and the Html.AntiForgeryToken(). Using that solution, the token is now being passed: var data = { … } // with token, key is ‘__RequestVerificationToken’ $.ajax({ type: “POST”, data: data, datatype: “json”, traditional: true, … Read more

How serious is this new ASP.NET security vulnerability and how can I workaround it?

I’ve just read on the net about a newly discovered security vulnerability in ASP.NET. You can read the details here. The problem lies in the way that ASP.NET implements the AES encryption algorithm to protect the integrity of the cookies these applications generate to store information during user sessions. This is a bit vague, but … Read more

Error: allowDefinition=’MachineToApplication’ beyond application level

I have downloaded the online project in ASP.Net. While running application I get an error It is an error to use a section registered as allowDefinition=’MachineToApplication’ beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS. What changes should i make in web.config or elsewhere … Read more

System.Security.SecurityException when writing to Event Log

I’m working on trying to port an ASP.NET app from Server 2003 (and IIS6) to Server 2008 (IIS7). When I try and visit the page on the browser I get this: Server Error in ‘/’ Application. Security Exception Description: The application attempted to perform an operation not allowed by the security policy. To grant this … Read more

ASP.NET MS11-100: how can I change the limit on the maximum number of posted form values?

Microsoft recently (12-29-2011) released an update to address several serious security vulnerabilities in the .NET Framework. One of the fixes introduced by MS11-100 temporarily mitigates a potential DoS attack involving hash table collisions. It appears this fix breaks pages that contain a lot of POST data. In our case, on pages that have very large … Read more

Is there any way to do a “Replace Or Insert” using web.config transformation?

I’m using web.config transformation as described in the below post in order to generate configs for different environments. http://vishaljoshi.blogspot.com/2009/03/web-deployment-webconfig-transformation_23.html I can do a “Replace” transformation by matching on the key, e.g. <add key=”Environment” value=”Live” xdt:Transform=”Replace” xdt:Locator=”Match(key)” /> And I can do “Inserts” e.g. <add key=”UseLivePaymentService” value=”true” xdt:Transform=”Insert” /> But what I would really find useful … Read more

ASP.NET Bundles how to disable minification

I have debug=”true” in both my web.config(s), and I just don’t want my bundles minified, but nothing I do seems to disable it. I’ve tried enableoptimisations=false, here is my code: //Javascript bundles.Add(new ScriptBundle(“~/bundles/MainJS”) .Include(“~/Scripts/regular/lib/mvc/jquery.validate.unobtrusive.js*”) .Include(“~/Scripts/regular/lib/mvc/jquery.validate*”) .Include(“~/Scripts/regular/lib/bootstrap.js”) .IncludeDirectory(“~/Scripts/regular/modules”, “*.js”, true) .IncludeDirectory(“~/Scripts/regular/pages”, “*.js”, true) .IncludeDirectory(“~/Scripts/regular/misc”, “*.js”, true)); //CSS bundles.Add(new StyleBundle(“~/bundles/MainCSS”) .Include(“~/Content/css/regular/lib/bootstrap.css*”) .IncludeDirectory(“~/Content/css/regular/modules”, “*.css”, true) .IncludeDirectory(“~/Content/css/regular/pages”, “*.css”, true)) … Read more