Entity framework 6 无法加载实体框架6.1.3

Entity framework 6 无法加载实体框架6.1.3,entity-framework-6,.net-4.5,Entity Framework 6,.net 4.5,所以我看到了这个问题的很多答案。似乎没有人能解决我的问题。我使用servicestack以自托管Web服务的形式运行该项目 是的,我已卸载并重新安装实体框架,清理解决方案,重新启动visual studio,重建 是,我已检查所有绑定重定向 是,我已检查EntityFramework Dll是否位于正在搜索Dll的文件夹中 是的,我有这个文件夹的权限(出于绝望,我把这个项目放在我自己的桌面上,以消除安全问题) 是的,nuget包、项目和所有配置都将.net 4.5.1作为其目标平台 尽管如此

所以我看到了这个问题的很多答案。似乎没有人能解决我的问题。我使用servicestack以自托管Web服务的形式运行该项目

  • 是的,我已卸载并重新安装实体框架,清理解决方案,重新启动visual studio,重建
  • 是,我已检查所有绑定重定向
  • 是,我已检查EntityFramework Dll是否位于正在搜索Dll的文件夹中
  • 是的,我有这个文件夹的权限(出于绝望,我把这个项目放在我自己的桌面上,以消除安全问题)
  • 是的,nuget包、项目和所有配置都将.net 4.5.1作为其目标平台
尽管如此,我还是得到了一个错误:

无法加载文件或程序集“EntityFramework”或其依赖项之一。访问被拒绝。“:“EntityFramework”


有人能告诉我一些工具来追踪问题的原因吗(除非你知道问题是什么;-D)。

结果证明“访问被拒绝”没有撒谎。我使用的上下文是一个包装器(继承自)一个实际的EntityFramework上下文,它在构造函数中实现了一些模拟。被模拟的用户没有访问bin目录的权限,这是错误的原因。

您是如何解决的?@user3610374我在我的开发机器上给了那个被模拟的用户访问我的bin目录的权限。这发生在我使用nuget Package时ge SimpleImpersonation。很容易忘记您正在模拟的帐户可能无法访问您的bin。+1插入咒语我从未想过这一点。我已经拉扯头发两天了……我甚至还没有测试过它,我已经知道这正是我的问题,因为我正在使用我为instant编写的自定义模拟程序类库延迟DBContext,这是我得到错误的地方…令人震惊。
=== Pre-bind state information ===
LOG: DisplayName = EntityFramework
 (Partial)
WRN: Partial binding information was supplied for an assembly:
WRN: Assembly Name: EntityFramework | Domain ID: 1
WRN: A partial bind occurs when only part of the assembly display name is provided.
WRN: This might result in the binder loading an incorrect assembly.
WRN: It is recommended to provide a fully specified textual identity for the assembly,
WRN: that consists of the simple name, version, culture, and public key token.
WRN: See whitepaper http://go.microsoft.com/fwlink/?LinkId=109270 for more information and common solutions to this issue.
LOG: Appbase = file:///C:/Users/MyUserName/Desktop/TempFolder/Web.MyProject.Service/bin/x86/Debug/
LOG: Initial PrivatePath = NULL
Calling assembly : EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089.
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: C:\Users\MyUserName\Desktop\TempFolder\Web.MyProject.Service\bin\x86\Debug\Web.MyProject.Service.vshost.exe.Config
LOG: Using host configuration file: 
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).
LOG: Attempting download of new URL file:///C:/Users/MyUserName/Desktop/TempFolder/Web.MyProject.Service/bin/x86/Debug/EntityFramework.DLL.
ERR: A fatal error occurred when retrieving next codebase for download (hr = 0x80070005).