Note that there are some explanatory texts on larger screens.

plurals
  1. POYet another Could not load file or assembly 'EntityFramework
    primarykey
    data
    text
    <p>Now, I promise that I've googled this. Stack overflow has about 4 or 5 solutions to this issue. Still, none of them seem to be working. I'm using EntityFramework 5 (4.4) with an MVC 3 project. This has worked fine in the past, but it's been a while since I've opened the project (about 20 days or so). I've just uninstalled &amp; reinstalled Sql Server 2008 R2 Express. I've rebooted since then.</p> <p>In all of my cshtml files I see an error underlineline on my @model line. When I mouse over it, I see the following: </p> <p>ASP.NET runtime error: Could not load file or assembly 'EntityFramework, Version=4.4.0.0, Culture=neutral, PublicTokenKey=b77a5c561934e089' or one of its dependencies. Access is denied.</p> <p>I have uninstalled and re-installed the EntityFramework package via package manager console. I've done it via nuget as well. I've closed and re-opened visual studio. I've removed the reference and added it manually via browsing for the dll.</p> <p>My web.config entry for this looks like: </p> <blockquote> <p>[open tag]section name="entityFramework" type="System.Data.Entity, EntityFramework, Version=4.4.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" [close tag]</p> </blockquote> <p>Any one have any thoughts?</p> <p><strong>EDIT 1 FULL ERROR DETAIL</strong></p> <pre><code>Server Error in '/' Application. Could not load file or assembly 'EntityFramework' or one of its dependencies. Access is denied. 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' or one of its dependencies. Access is denied. Source Error: An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. Assembly Load Trace: The following information can be helpful to determine why the assembly 'EntityFramework' could not be loaded. === Pre-bind state information === LOG: User = Unknown LOG: DisplayName = EntityFramework (Partial) WRN: Partial binding information was supplied for an assembly: WRN: Assembly Name: EntityFramework | Domain ID: 2 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:/MercurialProjects/ProxySetup/ProxySetup/ LOG: Initial PrivatePath = C:\MercurialProjects\ProxySetup\ProxySetup\bin Calling assembly : (Unknown). === LOG: This bind starts in default load context. LOG: Using application configuration file: C:\MercurialProjects\ProxySetup\ProxySetup\web.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:/Windows/Microsoft.NET/Framework/v4.0.30319/Temporary ASP.NET Files/root/014aecc8/d1c2eaf7/EntityFramework.DLL. LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/Temporary ASP.NET Files/root/014aecc8/d1c2eaf7/EntityFramework/EntityFramework.DLL. LOG: Attempting download of new URL file:///C:/MercurialProjects/ProxySetup/ProxySetup/bin/EntityFramework.DLL. LOG: Using application configuration file: C:\MercurialProjects\ProxySetup\ProxySetup\web.config LOG: Using host configuration file: 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 ERR: Failed to complete setup of assembly (hr = 0x80070005). Probing terminated. Stack Trace: [FileLoadException: Could not load file or assembly 'EntityFramework' or one of its dependencies. Access is denied.] [FileLoadException: Could not load file or assembly 'EntityFramework, Version=4.4.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies. Access is denied.] System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark&amp; stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +0 System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark&amp; stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +39 System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark&amp; stackMark, Boolean forIntrospection, Boolean suppressSecurityChecks) +132 System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark&amp; stackMark, Boolean forIntrospection) +144 System.Reflection.Assembly.Load(String assemblyString) +28 System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +46 [ConfigurationErrorsException: Could not load file or assembly 'EntityFramework, Version=4.4.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies. Access is denied.] System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +618 System.Web.Configuration.CompilationSection.LoadAllAssembliesFromAppDomainBinDirectory() +209 System.Web.Configuration.CompilationSection.LoadAssembly(AssemblyInfo ai) +130 System.Web.Compilation.BuildManager.GetReferencedAssemblies(CompilationSection compConfig) +178 System.Web.Compilation.BuildManager.GetPreStartInitMethodsFromReferencedAssemblies() +94 System.Web.Compilation.BuildManager.CallPreStartInitMethods() +332 System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, Exception appDomainCreationException) +677 [HttpException (0x80004005): Could not load file or assembly 'EntityFramework, Version=4.4.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies. Access is denied.] System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +9090988 System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +97 System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr) +258 Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.272 </code></pre> <p><strong>EDIT 2</strong></p> <p>Per the debug information above, I manually added all the dll's the application uses to the C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\014aecc8\d1c2eaf7 folder as that's what was eventually referenced as the error kept changing. </p> <p>I don't see an ASPNET user to assign permissions to for the C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\ directory. I've added: IUSR, NETWORK, NETWORK SERVICE, IIS_USRS (\IIS_ISURS) with full control. I'm still getting the error.</p> <p>As I was still getting Access Denied for errors, I gave Users full control of the folder on my machine. The application loads. So...this is a permission error. The question is, what account needs the permissions?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload