本文介绍了dot net 4.0需要哪个实体框架?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hii,



我使用的是dot net framework 4.0



我使用的是自定义提供商,但是当我使用gmail登录时,它会抛出一个错误说





'/'应用程序中的服务器错误。

无法加载文件或程序集'EntityFramework,Version = 4.4.0.0,Culture = neutral,PublicKeyToken = b77a5c561934e089'或其依赖项之一。定位的程序集的清单定义与程序集引用不匹配。 (来自HRESULT的异常:0x80131040)

描述:在执行当前Web请求期间发生了未处理的异常。请查看堆栈跟踪以获取有关错误及其源自代码的位置的更多信息。



异常详细信息:System.IO.FileLoadException:无法加载文件或程序集'EntityFramework,Version = 4.4.0.0,Culture = neutral,PublicKeyToken = b77a5c561934e089'或其依赖项之一。定位的程序集的清单定义与程序集引用不匹配。 (HRESULT异常:0x80131040)



来源错误:





第86行://用户已成功登录提供商

第87行://检查用户是否已在本地注册

第88行:if(OpenAuth.Login(authResult) .Provider,authResult.ProviderUserId,createPersistentCookie:false))

第89行:{

第90行:RedirectToReturnUrl();





源文件:e:\ E-books \ Torakami Technologies \ AutoProvidersSparepartsTrial\AutoSpareParts\AutoSparePart\Account\RegisterExternalLogin.aspx.cs Line:88



程序集加载跟踪:以下信息有助于确定程序集EntityFramework,Version = 4.4.0.0,Culture = neutral,PublicKeyToken = b77a5c561934e089无法进行的原因已加载。





===预绑定状态信息== =

日期:DisplayName = EntityFramework,Version = 4.4.0.0,Culture = neutral,PublicKeyToken = b77a5c561934e089

(完全指定)

LOG :Appbase = file:/// E:/ E-books / Torakami Technologies / AutoProvidersSparepartsTrial / AutoSpareParts / AutoSpareParts /

日志:初始PrivatePath = E:\ E-books \Torakami Technologies \ AutoProvidersSparepartsTrial \AutoSpareParts \ AutoSpareParts \ bin

调用程序集:Microsoft.AspNet.Membership.OpenAuth,Version = 1.0.0.0,Culture = neutral,PublicKeyToken = 31bf3856ad364e35。

===

日志:此绑定在默认加载上下文中启动。

日志:使用应用程序配置文件:E:\ E-books \Torakami Technologies \ AutoProvidersSparepartsTrial\AutoSpareParts\AutoSpareParts\web.config

日志:使用主机配置文件:C:\ Users \Nilesh \Documents\IISExpress\config\aspnet.config

日志:使用机器配置配置文件来自C:\ Windows \ Macrooft.NET \Framework\v4.0.30319\config\machine.config。

日志:政策后参考:EntityFramework,版本= 4.4 .0.0,Culture = neutral,PublicKeyToken = b77a5c561934e089

日志:尝试下载新的URL文件:/// C:/ Users / Nilesh / AppData / Local / Temp / Temporary ASP.NET Files / root /bdf53e2f/603a42fd/EntityFramework.DLL。

日志:尝试下载新的URL文件:/// C:/ Users / Nilesh / AppData / Local / Temp / Temporary ASP.NET Files / root / bdf53e2f / 603a42fd / EntityFramework / EntityFramework.DLL。

日志:尝试下载新的URL文件:/// E:/ E-books / Torakami Technologies / AutoProvidersSparepartsTrial / AutoSpareParts / AutoSpareParts / bin / EntityFramework。 DLL。

WRN:比较程序集名称导致不匹配:主要版本

错误:无法完成程序集的设置(hr = 0x80131040)。探测终止。





堆栈追踪:





[FileLoadException:无法加载文件或程序集'EntityFramework,Version = 4.4.0.0,Culture = neutral,PublicKeyToken = b77a5c561934e089'或其依赖项之一。定位的程序集的清单定义与程序集引用不匹配。 (来自HRESULT的异常:0x80131040)]

Microsoft.AspNet.Membership.OpenAuth.EFOpenAuthMembershipDatabase.GetMembershipUserName(String providerName,String providerUserId,Boolean updateLastUsed)+0

Microsoft.AspNet .Membership.OpenAuth.OpenAuthManager.Login(HttpContextBase context,String providerName,String providerUserId,Boolean createPersistentCookie)+285

Microsoft.AspNet.Membership.OpenAuth.OpenAuth.Login(String providerName,String providerUserId,Boolean createPersistentCookie)+109

AutoSpareParts.Account.RegisterExternalLogin.ProcessProviderResult()在e:\ E-books \Torakami Technologies \ AutoProvidersSparepartsTrial \AutoSpareParts \AutoSpareParts \Account\RegisterExternalLogin.aspx .cs:88

AutoSpareParts.Account.RegisterExternalLogin.Page_Load()在e:\ E-books \ Torakami Technologies \ AutoProvidersSparepartsTrial \AutoSpareParts \AutoSpareParts \Account \ RegisterExternalLogin.aspx.cs:39

System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender,EventArgs e)+9585477

System.Web.UI.Control.OnLoad (EventArgs e)+92

System.Web.UI.Control.LoadRecursive()+54

System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint,Boolean includeStagesAfterAsyncPoint )+772





版本信息:Microsoft .NET Framework版本:4.0.30319; ASP.NET版本:4.0.30319.33440



我试图将程序集升级到6.0但仍然遇到同样的问题..



I dongrade to 4.3.1



这里是我的web.config文件部分目前



< assemblybinding xmlns =urn:schemas-microsoft-com:asm.v1>

< dependentassembly>

< assemblyidentity name =DotNetOpenAuth。核心publickeytoken =2780ccd10d57b246>

< bindingredirect oldversion =1.0.0.0-4.0.0.0newversion =4.1.0.0>



< dependentassembly>

< assemblyidentity name =DotNetOpenAuth.AspNetpublickeytoken =2780ccd10d57b246>

< bindingredirect oldversion =0.0 .0.0-4.1.0.0newversion =4.1.0.0>



< dependentassembly>

< assemblyidentity name = EntityFrameworkpublickeytoken =b77a5c561934e089culture =中立>

< bindingredirect oldversion =0.0.0.0-4.3.1.0newversion =4.3.1.0>







但仍然得到相同的错误。请建议

Hii,

I am using dot net framework 4.0

I am using custom providers , but when i logged in using gmail it throws me an error saying


Server Error in '/' Application.
Could not load file or assembly 'EntityFramework, Version=4.4.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.IO.FileLoadException: Could not load file or assembly 'EntityFramework, Version=4.4.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

Source Error:


Line 86: // User has logged in with provider successfully
Line 87: // Check if user is already registered locally
Line 88: if (OpenAuth.Login(authResult.Provider, authResult.ProviderUserId, createPersistentCookie: false))
Line 89: {
Line 90: RedirectToReturnUrl();


Source File: e:\E-books\Torakami Technologies\AutoProvidersSparepartsTrial\AutoSpareParts\AutoSpareParts\Account\RegisterExternalLogin.aspx.cs Line: 88

Assembly Load Trace: The following information can be helpful to determine why the assembly 'EntityFramework, Version=4.4.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' could not be loaded.


=== Pre-bind state information ===
LOG: DisplayName = EntityFramework, Version=4.4.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
(Fully-specified)
LOG: Appbase = file:///E:/E-books/Torakami Technologies/AutoProvidersSparepartsTrial/AutoSpareParts/AutoSpareParts/
LOG: Initial PrivatePath = E:\E-books\Torakami Technologies\AutoProvidersSparepartsTrial\AutoSpareParts\AutoSpareParts\bin
Calling assembly : Microsoft.AspNet.Membership.OpenAuth, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35.
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: E:\E-books\Torakami Technologies\AutoProvidersSparepartsTrial\AutoSpareParts\AutoSpareParts\web.config
LOG: Using host configuration file: C:\Users\Nilesh\Documents\IISExpress\config\aspnet.config
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
LOG: Post-policy reference: EntityFramework, Version=4.4.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
LOG: Attempting download of new URL file:///C:/Users/Nilesh/AppData/Local/Temp/Temporary ASP.NET Files/root/bdf53e2f/603a42fd/EntityFramework.DLL.
LOG: Attempting download of new URL file:///C:/Users/Nilesh/AppData/Local/Temp/Temporary ASP.NET Files/root/bdf53e2f/603a42fd/EntityFramework/EntityFramework.DLL.
LOG: Attempting download of new URL file:///E:/E-books/Torakami Technologies/AutoProvidersSparepartsTrial/AutoSpareParts/AutoSpareParts/bin/EntityFramework.DLL.
WRN: Comparing the assembly name resulted in the mismatch: Major Version
ERR: Failed to complete setup of assembly (hr = 0x80131040). Probing terminated.


Stack Trace:


[FileLoadException: Could not load file or assembly 'EntityFramework, Version=4.4.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)]
Microsoft.AspNet.Membership.OpenAuth.EFOpenAuthMembershipDatabase.GetMembershipUserName(String providerName, String providerUserId, Boolean updateLastUsed) +0
Microsoft.AspNet.Membership.OpenAuth.OpenAuthManager.Login(HttpContextBase context, String providerName, String providerUserId, Boolean createPersistentCookie) +285
Microsoft.AspNet.Membership.OpenAuth.OpenAuth.Login(String providerName, String providerUserId, Boolean createPersistentCookie) +109
AutoSpareParts.Account.RegisterExternalLogin.ProcessProviderResult() in e:\E-books\Torakami Technologies\AutoProvidersSparepartsTrial\AutoSpareParts\AutoSpareParts\Account\RegisterExternalLogin.aspx.cs:88
AutoSpareParts.Account.RegisterExternalLogin.Page_Load() in e:\E-books\Torakami Technologies\AutoProvidersSparepartsTrial\AutoSpareParts\AutoSpareParts\Account\RegisterExternalLogin.aspx.cs:39
System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +9585477
System.Web.UI.Control.OnLoad(EventArgs e) +92
System.Web.UI.Control.LoadRecursive() +54
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +772


Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.33440

I tried to upgrade assembly to 6.0 but still get the same issue ..

I dongrade to 4.3.1

here is my web.config file section currently

<assemblybinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentassembly>
<assemblyidentity name="DotNetOpenAuth.Core" publickeytoken="2780ccd10d57b246">
<bindingredirect oldversion="1.0.0.0-4.0.0.0" newversion="4.1.0.0">

<dependentassembly>
<assemblyidentity name="DotNetOpenAuth.AspNet" publickeytoken="2780ccd10d57b246">
<bindingredirect oldversion="0.0.0.0-4.1.0.0" newversion="4.1.0.0">

<dependentassembly>
<assemblyidentity name="EntityFramework" publickeytoken="b77a5c561934e089" culture="neutral">
<bindingredirect oldversion="0.0.0.0-4.3.1.0" newversion="4.3.1.0">



but still getting same error .please suggest

推荐答案


这篇关于dot net 4.0需要哪个实体框架?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-05 19:33