So I have seen a bunch of answers to this question. None seem to resolve my issue. I am running the project as a self hosted webservice using servicestack.
Despite all of this, I still get the error:
Could not load file or assembly 'EntityFramework' or one of its dependencies. Access is denied.":"EntityFramework"
=== 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).
Can anyone point me at some tools to track down the cause of the problem (unless you know what the problem is ;-D).
Turns out the "Access is Denied" was not lying. The context I was working with was a wrapper around (inherited from) an actual EntityFramework context which implemented some impersonation in the constructor. The impersonated user did not have access to the bin directory which is the reason for the error.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With