Rider – Can't Build because the process cannot access the file because it is in use by another process

huangapple go评论72阅读模式
英文:

Rider - Can't Build because the process cannot access the file because it is in use by another process

问题

我来这里发布我遇到的错误,它突然出现了,然而我已经好几个小时没有碰过任何东西,我只是想重新构建因为我不知道我是否已经构建过。

Fody: 发生了一个未处理的异常:
异常:
由于另一个进程正在使用,无法访问文件 'E:\Unity Project\Curator\Curator\obj\x64\Debug\Curator.exe'类型:
System.IO.IOException
堆栈跟踪:
   在 System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   到 System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
   在 System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share)
   在 Mono.Cecil.ModuleDefinition.Write(String fileName, WriterParameters parameters) in C:\Code\Fody\cecil\Mono.Cecil\ModuleDefinition.cs:line 1144
   在 InnerWeaver.WriteModule() in C:\projects\fody\FodyIsolated\ModuleWriter.cs:line 18
   在 InnerWeaver.Execute() in C:\projects\fody\FodyIsolated\InnerWeaver.cs:line 114
来源:
mscorlib
目标站点:
Void WinIOError(Int32, System.String)

然而,我已经在相同类型的论坛上寻找了这个错误,但我找不到与我的错误相关的任何信息。

我已经做了以下工作:

  • 重新启动我的电脑。
  • 清除缓存 Rider(在VS上也一样)。
  • 删除被认为是已在使用的应用程序的项目。
  • 提到的 exe 文件不存在。
  • 查看提到的目录是否存在(暗示不存在)。
  • 切换构建类型(64位 -> 32位)和从调试切换到发布。

请注意,我无法再启动发布版或32位版本的构建应用程序。

我尝试编译我的其他项目,以查看错误是否一字不差地重复。

我还在Visual Studio 2022和Visual Studio Code上尝试过,问题仍然存在。

英文:

I come here to post the error I have, it appeared suddenly, yet I haven't touched anything for hours, I just wanted to rebuild because I didn't know if I had build.

Fody: An unhandled exception occurred:
Exception:
The process cannot access the file 'E:\Unity Project\Curator\Curator\obj\x64\Debug\Curator.exe' because it is in use by another process.
Kind:
System.IO.IOException
StackTrace:
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   to System.IO.
FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access,
File Share share)
   at Mono.Cecil.ModuleDefinition.Write(String fileName, WriterParameters parameters) in C:\Code\Fody\cecil\Mono.Cecil\ModuleDefinition.cs:line 1144
   at InnerWeaver.WriteModule() in C:\projects\fody\FodyIsolated\ModuleWriter.cs:line 18
   at InnerWeaver.Execute() in C:\projects\fody\FodyIsolated\InnerWeaver.cs:line 114
Source:
mscorlib
TargetSite:
Void WinIOError(Int32, System.String)

However, I have looked for the error on forums of the same style, but I can't find anything related to my error.

What I have already done:

  • Restart my PC.
  • Clean Cache Rider (Same on VS).
  • Delete items considered application already in use.
  • The exe mentioned does not exist.
  • See if the directories mentioned exist. (spoiler no).
  • Switch build type (64 -> 32) and from Debug to Release.

Note that I can no longer launch the build application in release or in 32 bit.

I tried to compile other of my projects to see if the error persists and I have exactly the same error character by character.

I also tried on Visual Studio 2022 and Visual Studio Code, the problem persists.

答案1

得分: 1

好的,我找到了错误。

如果这种情况发生在你身上,当然,删除"\obj\"文件夹中的所有文件。
删除你的缓存(Build,System cache,Local History,VS Log Cache & Indexes,Engine cache & cookies。

File -> Invalidate Caches -> Check all options -> Invalidate and Restart

通常情况下,这应该会修复错误。

英文:

OK, I found the error.

If this happens to you, of course, delete all the files in the "\obj\" folder.
Delete your caches (Build, System cache, Local History, VS Log Cache & Indexes, Engine cache & cookies.

File -> Invalidate Caches -> Check all options -> Invalidate and Restart.

Normally this should fix the error.

huangapple
  • 本文由 发表于 2023年6月22日 19:28:52
  • 转载请务必保留本文链接:https://go.coder-hub.com/76531413.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定