错误:在 Visual Studio 2013 中找不到类型或命名空间名称“ApplicationUser" [英] Error: The type or namespace name 'ApplicationUser' could not be found in Visual Studio 2013

查看:34
本文介绍了错误:在 Visual Studio 2013 中找不到类型或命名空间名称“ApplicationUser"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在关注RESTful WCF 服务"教程.但是当我构建我的应用程序时,我收到了这个错误:

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

找不到类型或命名空间名称ApplicationUser"(您是否缺少 using 指令或程序集引用?)c:\users\basma\documents\visual studio 2013\Projects\OnlineStore2\OnlineStore2_Client\App_Start\IdentityConfig.cs

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

我已经搜索过很多关于Microsoft ASP.NET Identity.owin"的答案,但我添加了此参考但仍然出现此错误

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

推荐答案

创建一个从 IdentityUser 派生的名为 ApplicationUser 的类.它不需要任何属性或方法,但您可以使用任何您想存储的关于系统上每个用户的信息(例如姓名、地址等)自由地扩展它.

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
}

这篇关于错误:在 Visual Studio 2013 中找不到类型或命名空间名称“ApplicationUser"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆