简体   繁体   English

mvc5中的配置错误

[英]Configuration Error in mvc5

I'm trying to add authentication and authorization to my website.I'm ding it with a help of tutorial. 我正在尝试向我的网站添加身份验证和授权,并在教程的帮助下进行验证。 I added to web.config file and global.asax file following code as the tutorial does.But it gives me an error when i try to run the application.can anyone explain the error that i'v done..I created project by choosing "NO authentication" and I've installed Microsoft.AspNet.WebHelpers and Microsoft.AspNet.WebPages.Data packages.....I also added the WebMatrix.Data and WebMatrix.WebData referencesto the application 我按照本教程的代码在web.config文件和global.asax文件中添加了以下代码,但是当我尝试运行应用程序时它给了我一个错误。任何人都可以解释我所做的错误..我通过选择创建项目“没有身份验证”,并且我已经安装了Microsoft.AspNet.WebHelpers和Microsoft.AspNet.WebPages.Data程序包.....我还向应用程序添加了WebMatrix.Data和WebMatrix.WebData引用

web.config file web.config文件

<system.web>
<compilation debug="true" targetFramework="4.5" />
<httpRuntime targetFramework="4.5" />


<membership defaultProvider="ePlannerProvider">
<providers>
<clear />
<add name="ePlannerProvider" type="WebMatrix.WebData.ePlannerProvider, WebMatrix.WebData" />
</providers>  
</membership>
<roleManager enabled="true"/>

</system.web>

Global.asax file Global.asax文件

WebSecurity.InitializeDatabaseConnection("EPlannerDatabaseEntities", "User", "Id", "Email", false);

Error message: 错误信息:

Parser Error Message: Could not load type 'WebMatrix.WebData.ePlannerProvider' from assembly 'WebMatrix.WebData'. 解析器错误消息:无法从程序集“ WebMatrix.WebData”中加载类型“ WebMatrix.WebData.ePlannerProvider”。

Source Error: 源错误:

<providers>
<clear />
<add name="ePlannerProvider" type="WebMatrix.WebData.ePlannerProvider, WebMatrix.WebData" />
</providers>  
</membership>

Error message says the type is not found. 错误消息指出找不到该类型。

Try to see version is right and use object browser to see if the class exists. 尝试查看版本是否正确,然后使用对象浏览器查看该类是否存在。

Also in reference, go to properties and set copy local as true. 另外,请参考属性,将本地副本设置为true。

Typically class names start with capital character 通常,类名以大写字母开头

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM