2

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 Answers1

1

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.