I can't use email as Username with MVC5 Microsoft.AspNet.Identity

Problem:

I want to use email (or a dot in the username!) as the username with Microsoft.AspNet.Identity in MVC 5 application. But when I do I get the following error:

User name ... is invalid, can only contain letters or digits.

Solution:

In the AccountController constructor that takes a userManager as a parameter add the following code:

UserManager.UserValidator = new UserValidator<ApplicationUser>(UserManager)
 { AllowOnlyAlphanumericUserNames = false };

Error When renaming ASP.NET MVC 5 applciation

I had this issue a few times already, so I will write down the procedure I follow also as a reminder for myself:

  1. Replace all of the old solution name with the new one.
  2. Navigate to Properties under each project and change the Assembly Name and Default Namespace fields to new solution name.
  3. Go to solution folder and rename all project folders with the new solution name.
  4. Remove all files under bin and obj folders.
  5. Solution will not be able to load projects. Remove all projects and add them again.
  6. Re-build the project.

Source: http://stackoverflow.com/questions/21701297/error-when-renaming-asp-net-mvc-5-applciation

VS 2010 Unable to automatically step into the server

If you need to debug a WCF Server, or somehow need to step into code on IIS, you will need to do the following to prevent the message  “Unable to automatically step into the server. Unable to determine a stopping location”. The message might be slightly different but generally it means you can't debug in IIS!

It turns out that Visual Studio 2010 comes with a default setting to debug ‘Just my code’.

To correct the problem, go to Tools – Options – Debugging – General and switch off the option ‘enable just my code’.  

And of course don’t forget to set debug="true" in the web.config file of the webservice. Double check your publishing Transformations too if using any, as that might be removing the debug="true" property in your web.Config file.

This will hopefully help someone else out there!

Sys is undefined (Telerik)

When using Authentication with a Web Application you might get Sys is undefined when starting up in Visual Studio using IE. This is an Authentication issue that is resolved by using this solution.

 

 

 <location path="Telerik.Web.UI.WebResource.axd">
 <system.web>
 <authorization>
 <allow users="*"/>
 </authorization>
 </system.web>
 </location>

 

Hope this helps someone out there!

IIS 7.x Timeout when Debugging in Visual Studio

If you are annoyed at the IIS timeouts when running .NET code via Visual Studio then you'll want you know how to fix that problem!

You can do 1 of 2 things.
* Go to the Application Pool for the Web Application you are working with. Select the Advanced Settings. Set the Ping Enabled property to False. This will allow you debugging to run forever.
* If you prefer to allow IIS to continue the monitoring process then change the Ping Maximum Response Timeout value to something larger than 90 seconds (default value).