Visual Studio 2013 Scaffolding Error

If you have recently installed a package with T4Scaffolding dependency (ex. MVCMailer uses T4Scaffolding.Core), then you can uninstall T4Scaffolding.Core and restart VS 2013. Notice that MvcMailer which caused this in my case, won’t work in 2013. Best is to check your references or packages for suspects. From comments: Uninstalling it didn’t seem to work for … Read more

Is “jquery.unobtrusive-ajax.js” obsolete?

jquery.unobtrusive-ajax.js is a Microsoft library for supporting @Ajax.* helpers, this is a plugin that unobtrusively sets up jQuery Ajax. If you use @Ajax helpers in your code, like ActionLink or BeginForm, along with updating jQuery you have to update the Microsoft jQuery Unobtrusive Ajax, otherwise you can remove it. If you remove reference to the … Read more

ASP.NET Identity 2 UserManager get all users async

There is no way to do this asynchronously with the UserManager class directly. You can either wrap it in your own asynchronous method: (this might be a bit evil) public async Task<IQueryable<User>> GetUsersAsync { return await Task.Run(() => { return userManager.Users(); } } Or use the ToListAsync extension method: public async Task<List<User>> GetUsersAsync() { using … Read more

Email Confirmation with MVC 5 and Asp.net Identity

I have written a step-by-step article on how to add email confirmation when using ASP.NET Identity. You can get the source code here in the project folder AspNetIdentity\AspNetIdentityRefApp. I have also created a service layer that encapsulates ASP.NET Identity, making it easier to incorporate in new MVC 5 applications and mimics the WebSecurity API used … Read more

Enable CORS for Web Api 2 and OWIN token authentication

I know your issue was solved inside comments, but I believe is important to understand what was causing it and how to resolve this entire class of problems. Looking at your code I can see you are setting the Access-Control-Allow-Origin header more than once for the Token endpoint: app.UseCors(Microsoft.Owin.Cors.CorsOptions.AllowAll); And inside GrantResourceOwnerCredentials method: context.OwinContext.Response.Headers.Add(“Access-Control-Allow-Origin”, new[] … Read more

ASP.NET Identity vs Simple membership Pros and Cons?

@Roman references some good articles that looks at the pros and cons of ASP.NET Identity and the membership provider model. ASP.NET Identity gets away from the membership provider model, which I believe is a good thing. There are some definite problems with Simple Membership when you wanted more advanced security features and if it was … Read more

How to create ASP.Net Identity tables inside existing database?

Run this SQL Script on the database. /****** Object: Table [dbo].[AspNetRoles] Script Date: 15-Mar-17 10:27:06 PM ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TABLE [dbo].[AspNetRoles]( [Id] [nvarchar](128) NOT NULL, [Name] [nvarchar](256) NOT NULL, CONSTRAINT [PK_dbo.AspNetRoles] PRIMARY KEY CLUSTERED ( [Id] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS … Read more

tech