Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error: The type or namespace name 'ApplicationUser' could not be found in Visual Studio 2013

I am following the "RESTful WCF Service" tutorial. But when I built my application I get this error:

The type or namespace name 'ApplicationUser' could not be found (are you missing a using directive or an assembly reference?) c:\users\basma\documents\visual studio 2013\Projects\OnlineStore2\OnlineStore2_Client\App_Start\IdentityConfig.cs

I've searched and many answers where talking about "Microsoft ASP.NET Identity.owin" but I added this reference but still get this error

like image 901
BDeveloper Avatar asked Dec 09 '15 10:12

BDeveloper


2 Answers

Create a class called ApplicationUser that derives from IdentityUser. It doesn't need to have any properties or methods, but you can freely extend it with any information you want to store about each user you have on the system (think name, addresses, etc.).

public class ApplicationUser : IdentityUser
{
    public virtual string Email { get; set; } // example, not necessary
}
like image 131
blas3nik Avatar answered Nov 08 '22 00:11

blas3nik


Linking the namespace

using YourProjectName.Models;

worked for me. In the post's case, "YourProjectName" is "OnlineStore2"

like image 22
coolhand Avatar answered Nov 08 '22 00:11

coolhand