jbevain / cecil

Cecil is a library to inspect, modify and create .NET programs and libraries.
MIT License
2.77k stars 630 forks source link

System.IO.IOException : The process cannot access the file 'xxx.dll' because it is being used by another process. #836

Closed Quaverflow closed 2 years ago

Quaverflow commented 2 years ago

Hi Jb,

cecilissue

I've been trying to use Cecil to hook methods on the executing assembly (see attached picture), just to start getting used to the framework. Unfortunately, no matter what I do, I can't get it to work. Using the ReadWrite = true will throw an exception. Not using ReadWrite will not insert the new method call before the old one.

Using XUnit and .net6

Could you please point me in the right direction? Thank you in advance.

Cheers, Mirko