简体   繁体   English

System.IO.FileLoadException:'无法加载文件或程序集'EntityFramework或其依赖项之一。 访问被拒绝。

[英]System.IO.FileLoadException: 'Could not load file or assembly 'EntityFramework or one of its dependencies. Access is denied.'

System.IO.FileLoadException HResult=0x80070005 Message=Could not load file or assembly 'EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies. System.IO.FileLoadException HResult = 0x80070005消息=无法加载文件或程序集“ EntityFramework,版本= 6.0.0.0,区域性=中性,PublicKeyToken = b77a5c561934e089”或其依赖项之一。 Access is denied. 访问被拒绝。

I understand that this is a common issue however my situation is different. 我了解这是一个常见问题,但是我的情况有所不同。 I downgraded the .net version that my program was using and cleaned and rebuilt the solution. 我降级了我的程序正在使用的.net版本,并对其进行了清理和重建。 I now get that error message as soon as I try to start the program. 现在,当我尝试启动程序时,我立即收到该错误消息。

I have tried the following: 我尝试了以下方法:

  • rebuilt and cleaned solution 重建和清洗的解决方案
  • Deleted bin folder and rebuilt 删除bin文件夹并重建
  • Deleted entity framework reference and added it again 删除实体框架参考,然后再次添加
  • Set permissions for all users to full control for all folders and subfolders 设置所有用户的权限,以完全控制所有文件夹和子文件夹
  • Ran SysInternals Process Monitor and didn't see an Access Denied status anywhere 跑了SysInternals Process Monitor,在任何地方都没有看到“访问被拒绝”状态
  • Tried to downgrade entity framework version 试图降级实体框架版本
  • Created a brand new project and copied the files over and still getting the same error message 创建了一个全新的项目并将文件复制过来,仍然收到相同的错误消息
  • Restarted visual studio 重新启动Visual Studio
  • Ran visual studio as administrator Ran Visual Studio作为管理员
  • Went back to the original .net version that my program was using 回到我的程序使用的原始.net版本
  • Deleted and reinstalled the nuget package 删除并重新安装了nuget软件包

Where do I go from here? 我从这里去哪里? Nothing from any posts I see on this website is fixing this issue. 我在此网站上看到的任何帖子都无法解决此问题。

UPDATE: This is a screenshot from a program that uses the same version of entity framework and it is currently working and below is a screenshot of the program where I can't get it to work. 更新:这是使用相同版本的实体框架的程序的屏幕截图,并且目前正在运行,下面是该程序的屏幕快照,我无法使其正常工作。 You can see the different icons in the working version so my only guess is that it is related but I don't know what the blue symbols mean. 您可以在工作版本中看到不同的图标,因此我唯一的猜测是它是相关的,但我不知道蓝色符号的含义。 Any guesses? 有什么猜想吗?

工作程序

程序不起作用

If it's a web app 如果是网络应用

  1. CMD as admin and run IISReset command if you don't use IISExpress 如果您不使用IISExpress,则以CMD作为管理员并运行IISReset命令
  2. You should clear the .net cache manually delete the temp folder on the Microsoft.Net folder on windows https://stackoverflow.com/a/17651986/1979151 您应该清除.net缓存以手动删除Windows https://stackoverflow.com/a/17651986/1979151上Microsoft.Net文件夹上的temp文件夹
  3. Change the platform target from 64 to 32 to AnyCPU 将平台目标从64更改为32到AnyCPU
  4. Try to enable 32bit apps on the app pool advanced settings 尝试在应用程序池高级设置上启用32位应用程序
  5. For sorry, Restart the machine 抱歉,重新启动机器

I hope that can help you 希望对您有帮助

暂无
暂无

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

相关问题 : System.IO.FileLoadException: 无法加载文件或程序集“EntityFramework” - : System.IO.FileLoadException: Could not load file or assembly 'EntityFramework' 无法加载文件或程序集或其依赖项之一。 拒绝访问 - Could not load file or assembly or one of its dependencies. Access is denied System.IO.FileLoadException:无法加载文件或程序集 - System.IO.FileLoadException: Could not load file or assembly 无法加载文件或程序集“System.Web,Version = 4.0.0.0,Culture = neutral”或其依赖项之一。 访问被拒绝 - Could not load file or assembly 'System.Web, Version=4.0.0.0, Culture=neutral' or one of its dependencies. Access is denied 无法加载文件或程序集“ businesslogic”或其依赖项之一。 拒绝访问 - Could not load file or assembly 'businesslogic' or one of its dependencies. Access is denied 无法加载文件或程序集“ Moxiecode.TinyMCE”或其依赖项之一。 拒绝访问 - Could not load file or assembly 'Moxiecode.TinyMCE' or one of its dependencies. Access is denied Umbraco 7-无法加载文件或程序集“ Microsoft.IdentityModel”或其依赖项之一。 拒绝访问 - Umbraco 7- Could not load file or assembly 'Microsoft.IdentityModel' or one of its dependencies. Access is denied 无法加载文件或程序集“ICSharpCode.SharpZipLib”或其依赖项之一。 访问被拒绝 - Could not load file or assembly 'ICSharpCode.SharpZipLib' or one of its dependencies. Access is denied 如何解决无法加载文件或程序集'Glimpse.Core'或其依赖项之一。 访问被拒绝 - how to solve Could not load file or assembly 'Glimpse.Core' or one of its dependencies. Access is denied 无法加载文件或程序集“Microsoft.CodeDom.Providers.DotNetCompilerPlatform 或其依赖项之一。” 访问被拒绝 - Could not load file or assembly 'Microsoft.CodeDom.Providers.DotNetCompilerPlatform or one of its dependencies. Access is denied
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM