pamidur / aspect-injector

AOP framework for .NET (c#, vb, etc)
Apache License 2.0
745 stars 112 forks source link

AspectInjector|2.4.2 : error AI_ERR0: Processing failure: System.IO.IOException: The process cannot access the file *.pdb' because it is being used by another process. #141

Closed matt-cochran closed 2 years ago

matt-cochran commented 3 years ago

I have a solution with over 80 projects and am finding file io contention during the build in github on umbuntu (latest). It works fine when I build locally in windows both through Visual studio and the dotnet build command.

matt-cochran commented 3 years ago

callstack:

at System.IO.FileStream.ValidateFileHandle(SafeFileHandle fileHandle) at System.IO.FileStream.CreateFileOpenHandle(FileMode mode, FileShare share, FileOptions options) at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options) at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share) at Mono.Cecil.ModuleDefinition.GetFileStream(String fileName, FileMode mode, FileAccess access, FileShare share) at Mono.Cecil.ModuleDefinition.ReadModule(String fileName, ReaderParameters parameters) at Mono.Cecil.AssemblyDefinition.ReadAssembly(String fileName, ReaderParameters parameters) at FluentIL.PatcherBase.ReadAssembly(String assemblyFile, IAssemblyResolver resolver, Boolean readSymbols, Boolean verbose) at FluentIL.PatcherBase.Process(String assemblyFile, IAssemblyResolver resolver, Boolean optimize, Boolean verbose) at FluentIL.PatcherBase.Process(String assemblyFile, IReadOnlyList1 references, Boolean optimize, Boolean verbose) at AspectInjector.Compiler.Execute(String filename, IReadOnlyList1 references, Boolean optimize, Boolean verbose). Please submit an issue to https://github.com/pamidur/aspect-injector AspectInjector|2.4.2: Found 1 aspects, 0 injections

pamidur commented 3 years ago

Hi @matt-cochran , thanks for your report and PR! Do you use any other tool except AspectInjector? The reason I'm asking is that AI plugs itself the following way:

<Target Name="InjectAspects" AfterTargets="CoreCompile"/>

Thus it might happen than some other tool does the same and tries to access same pdb file in parallel

pamidur commented 3 years ago

@matt-cochran , Could you also check if v2.4.4-pre1 makes any difference?

pamidur commented 2 years ago

We could not reproduce this one fore a while, so I'll close the issue. Please feel free to reopen any time!