我一直在得到下面的錯誤和天爲了我不明白爲什麼。我沒有做任何改變,除了升級到Windows 10.我降級了我的EF和升級,以確保我有相同的版本,但沒有解決。我嘗試了所有選項,自己託管應用程序,但即使這樣也沒有幫助消除Visual Studio問題。EF降級:無法加載文件或程序集'EntityFramework'或它的一個依賴關係
請感謝您的任何建議。
無法加載文件或程序集'EntityFramework'
或其某個依賴項。因爲它被另一個進程 過程不能訪問該文件
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. The process cannot access the file because it is being used by another process. (Exception from HRESULT: 0x80070020)
源錯誤:
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.
===預綁定狀態信息===
> 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:/src/prjPptsWa/ LOG: Initial PrivatePath =
> C:\src\prjPptsWa\bin Calling assembly : (Unknown).
> === LOG: This bind starts in default load context. LOG: Using application configuration file: C:\src\prjPptsWa\web.config LOG: Using
> host configuration file:
> C:\Users\Documents\IISExpress\config\aspnet.config 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/17d130d2/d3bf1590/EntityFramework.DLL. LOG:
> Attempting download of new URL
> file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/Temporary
> ASP.NET
> Files/root/17d130d2/d3bf1590/EntityFramework/EntityFramework.DLL. LOG:
> Attempting download of new URL
> file:///C:/src/prjPptsWa/bin/EntityFramework.DLL. LOG: Using
> application configuration file: C:\src\prjPptsWa\web.config LOG: Using
> host configuration file:
> C:\Users\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=6.0.0.0,
> Culture=neutral, PublicKeyToken=b77a5c561934e089 ERR: Failed to
> complete setup of assembly (hr = 0x80070020). Probing terminated.
堆棧跟蹤:
[FileLoadException: Could not load file or assembly 'EntityFramework' or one of its dependencies. The process cannot access the file because it is being used by another process. (Exception from HRESULT: 0x80070020)]
[FileLoadException: Could not load file or assembly 'EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies. The process cannot access the file because it is being used by another process. (Exception from HRESULT: 0x80070020)]
System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +0
System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +36
System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +152
System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean forIntrospection) +77
System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +21
System.Reflection.Assembly.Load(String assemblyString) +28
System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +38
[ConfigurationErrorsException: Could not load file or assembly 'EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies. The process cannot access the file because it is being used by another process. (Exception from HRESULT: 0x80070020)]
System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +738
System.Web.Configuration.CompilationSection.LoadAllAssembliesFromAppDomainBinDirectory() +217
System.Web.Configuration.CompilationSection.LoadAssembly(AssemblyInfo ai) +130
System.Web.Compilation.BuildManager.GetReferencedAssemblies(CompilationSection compConfig) +170
System.Web.Compilation.BuildManager.GetPreStartInitMethodsFromReferencedAssemblies() +92
System.Web.Compilation.BuildManager.CallPreStartInitMethods(String preStartInitListPath, Boolean& isRefAssemblyLoaded) +290
System.Web.Compilation.BuildManager.ExecutePreAppStart() +157
System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, Exception appDomainCreationException) +531
[HttpException (0x80004005): Could not load file or assembly 'EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies. The process cannot access the file because it is being used by another process. (Exception from HRESULT: 0x80070020)]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +9946132
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +90
System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +261
更新: -得到了我的問題的修復,修復是消除映射並重新映射到另一個文件夾。出於某種原因,舊文件夾保存了dll的加載。
你試過[this](https://www.google.co.in/search?q=Could+not+load+file+or+assembly+%27EntityFramework%27&oq=Could+not+load+file+或+程序集+%27EntityFramework%27&aqs = chrome..69i57j69i60&sourceid = chrome&ie = UTF-8)發佈此問題之前 –
我看了所有鏈接 –