2016-06-28 25 views
0

我一直在得到下面的錯誤和天爲了我不明白爲什麼。我沒有做任何改變,除了升級到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的加載。

+0

你試過[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)發佈此問題之前 –

+0

我看了所有鏈接 –

回答

0

您的EntityFramework DLL正在被系統中的另一個程序使用。這是編譯時無法在bin中加載此程序集的原因。我無法分辨哪個程序正在使用此dll。你的機器中是否安裝了Panda AV?如果是禁用它,並嘗試如果它的工作。

+0

有幾個similer問題[鏈接](http://stackoverflow.com/questions/32412632/could-not-load-file-or-assembly-or-one-its-dependencies-the-process-canno),[link](http://stackoverflow.com/questions/32890371/could- not-load-file-or-assembly-xxx-data-the-process-can-access-the-file-be) –

+0

我刪除了我的EntityFramework,看看我是否收到你不能刪除dll的消息由另一個進程,但它被刪除。一旦我重建它,該dll會再次出現。我停止了所有的反病毒。 –

+0

它是如此工作?! –

相關問題