无法加载文件或程序集“ xxx.Data”,因为其他进程正在使用该文件,所以该进程无法访问该文件

编程入门 行业动态 更新时间:2024-10-26 17:33:31
本文介绍了无法加载文件或程序集“ xxx.Data”,因为其他进程正在使用该文件,所以该进程无法访问该文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

从今天开始,我在一个已经工作了几个月并且一直工作的项目中遇到了这个错误。

I have this error since today in a project which I have worked for months and has always worked.

我尝试清洁解决方案并进行重建,并且构建过程完美。 我尝试重新启动VS和PC,但没有任何效果。

I tried cleaning the solution and rebuild, and building works perfect. I tried restarting VS and the PC and nothing works.

所以问题不在代码中

无法加载文件或程序集 xxx.Data或其依赖项之一。该进程无法访问该文件,因为该文件正在被另一个进程使用。 (来自HRESULT的异常:0x80070020)

Could not load file or assembly 'xxx.Data' or one of its dependencies. The process cannot access the file because it is being used by another process. (Exception from HRESULT: 0x80070020)

说明:在执行当前Web请求期间发生未处理的异常。请查看堆栈跟踪,以获取有关错误及其在代码中起源的更多信息。

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.

异常详细信息:System.IO.FileLoadException:无法加载文件或程序集 xxx.Data或其依赖项之一。该进程无法访问该文件,因为该文件正在被另一个进程使用。 (来自HRESULT的异常:0x80070020)

Exception Details: System.IO.FileLoadException: Could not load file or assembly 'xxx.Data' or one of its dependencies. The process cannot access the file because it is being used by another process. (Exception from HRESULT: 0x80070020)

源错误:

在执行当前Web请求期间生成了未处理的异常。可以使用下面的异常堆栈跟踪来标识有关异常的来源和位置的信息。

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.

程序集加载跟踪:以下信息有助于确定为什么程序集' xxx.Data'无法加载。

Assembly Load Trace: The following information can be helpful to determine why the assembly 'xxx.Data' could not be loaded.

=== Pre-bind state information === LOG: DisplayName = xxx.Data (Partial) WRN: Partial binding information was supplied for an assembly: WRN: Assembly Name: xxx.Data | 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 go.microsoft/fwlink/?LinkId=109270 for more information and common solutions to this issue. LOG: Appbase = file:///C:/Proyectos/xxx/xxx/ LOG: Initial PrivatePath = C:\Proyectos\xxx\xxx\bin Calling assembly : (Unknown). === LOG: This bind starts in default load context. LOG: Using application configuration file: C:\Proyectos\xxx\xzxx\web.config LOG: Using host configuration file: C:\Users\Esteban\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:/Users/Esteban/AppData/Local/Temp/Temporary ASP.NET Files/root/8076610e/464a474/xxx.Data.DLL. LOG: Attempting download of new URL file:///C:/Users/Esteban/AppData/Local/Temp/Temporary ASP.NET Files/root/8076610e/464a474/xxx.Data/xxx.Data.DLL. LOG: Attempting download of new URL file:///C:/Proyectos/xxx/xxx/bin/xxx.Data.DLL. LOG: Using application configuration file: C:\Proyectos\xxx\xxx\web.config LOG: Using host configuration file: C:\Users\Esteban\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). ERR: Failed to complete setup of assembly (hr = 0x80070020). Probing terminated.

推荐答案

如消息所示,该文件正在使用中。这不是Visual Studio或.NET,而是操作系统。

As the message says, the file is in use. This isn't a Visual Studio or .NET thing, it is an operating system thing.

另一个程序正在使用该文件,该文件可以是病毒扫描程序,另一个应用程序

Another program is using the file, that can be a virus scanner, another application that is running, or even Visual Studio (sometimes the debugger keeps a file locked).

当您尝试删除或重命名时,Windows会告诉您是由哪个程序负责锁定的程序文件。我建议这样做,以查看哪个程序锁定了您的文件。

Windows tells you what program is responsible for the lock when you try to delete or rename the file. I would recommend to do that to see what program is locking your file.

更多推荐

无法加载文件或程序集“ xxx.Data”,因为其他进程正在使用该文件,所以该进程无法访问该文件

本文发布于:2023-11-12 16:59:55,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1582035.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:该文件   进程   无法访问   加载   以该

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!