11

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

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
BDeveloper
  • 1,175
  • 6
  • 24
  • 44
  • Do you have the nuget packages/references to all the correct libraries. Do you have an ApplicationUser class anywhere in your project? – Lewis Taylor Dec 09 '15 at 10:09
  • Can you put a link to the tutorial you are following? You probably need to make a class called ApplicationUser which inherits form IdentityUser. Edit: Or your namespaces are not set up correctly therefore ApplicationUser cannoy be found – Lewis Taylor Dec 09 '15 at 10:15
  • this is the video i've been following https://www.youtube.com/watch?v=EZJWubzKA8Y – BDeveloper Dec 09 '15 at 10:22
  • should i create a class ApplicationUser under App_Start Folder which inherits from IdentityUser. and what about its content?!! – BDeveloper Dec 09 '15 at 10:23

2 Answers2

20

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
}
blas3nik
  • 1,381
  • 11
  • 21
3

Linking the namespace

using YourProjectName.Models;

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

coolhand
  • 1,876
  • 5
  • 25
  • 46