stavroskasidis / BlazorWasmAntivirusProtection

Antivirus protection for Blazor Wasm projects

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ObfuscateDlls fails - System.IO.IOException: The process cannot access the file because it is being used by another process

sykesbPragmatics opened this issue · comments

I am running builds on a AWS based virtual machine and the build step constantly fails during the Xor step on random files. I originally thought that the Antivirus was causing it but the failures are still consistently happening with the Antivirus disabled.

I strongly suspect that the process is stepping on itself.

D:\BuildAgents\BuildTools\NugetCache\blazorwasmantivirusprotection\2.4.0\build\net6.0\BlazorWasmAntivirusProtection.targets(28,3): error MSB4018: The "ObfuscateDlls" task failed unexpectedly. [D:\BuildAgents\BuildServer\_work\1\s\Src\Project.Client\Project.Client.csproj]
D:\BuildAgents\BuildTools\NugetCache\blazorwasmantivirusprotection\2.4.0\build\net6.0\BlazorWasmAntivirusProtection.targets(28,3): error MSB4018: System.IO.IOException: The process cannot access the file 'D:\BuildAgents\BuildServer\_work\1\s\Src\Project.Client\obj\Release\net6.0\linked\CurrieTechnologies.Razor.Clipboard.dll' because it is being used by another process. [D:\BuildAgents\BuildServer\_work\1\s\Src\Project.Client\Project.Client.csproj]
D:\BuildAgents\BuildTools\NugetCache\blazorwasmantivirusprotection\2.4.0\build\net6.0\BlazorWasmAntivirusProtection.targets(28,3): error MSB4018:    at Microsoft.Win32.SafeHandles.SafeFileHandle.CreateFile(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options) [D:\BuildAgents\BuildServer\_work\1\s\Src\Project.Client\Project.Client.csproj]
D:\BuildAgents\BuildTools\NugetCache\blazorwasmantivirusprotection\2.4.0\build\net6.0\BlazorWasmAntivirusProtection.targets(28,3): error MSB4018:    at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize) [D:\BuildAgents\BuildServer\_work\1\s\Src\Project.Client\Project.Client.csproj]
D:\BuildAgents\BuildTools\NugetCache\blazorwasmantivirusprotection\2.4.0\build\net6.0\BlazorWasmAntivirusProtection.targets(28,3): error MSB4018:    at System.IO.File.OpenHandle(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize) [D:\BuildAgents\BuildServer\_work\1\s\Src\Project.Client\Project.Client.csproj]
D:\BuildAgents\BuildTools\NugetCache\blazorwasmantivirusprotection\2.4.0\build\net6.0\BlazorWasmAntivirusProtection.targets(28,3): error MSB4018:    at System.IO.File.WriteAllBytes(String path, Byte[] bytes) [D:\BuildAgents\BuildServer\_work\1\s\Src\Project.Client\Project.Client.csproj]
D:\BuildAgents\BuildTools\NugetCache\blazorwasmantivirusprotection\2.4.0\build\net6.0\BlazorWasmAntivirusProtection.targets(28,3): error MSB4018:    at BlazorWasmAntivirusProtection.Tasks.ObfuscateDlls.Execute() [D:\BuildAgents\BuildServer\_work\1\s\Src\Project.Client\Project.Client.csproj]
D:\BuildAgents\BuildTools\NugetCache\blazorwasmantivirusprotection\2.4.0\build\net6.0\BlazorWasmAntivirusProtection.targets(28,3): error MSB4018:    at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute() [D:\BuildAgents\BuildServer\_work\1\s\Src\Project.Client\Project.Client.csproj]
D:\BuildAgents\BuildTools\NugetCache\blazorwasmantivirusprotection\2.4.0\build\net6.0\BlazorWasmAntivirusProtection.targets(28,3): error MSB4018:    at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask(ITaskExecutionHost taskExecutionHost, TaskLoggingContext taskLoggingContext, TaskHost taskHost, ItemBucket bucket, TaskExecutionMode howToExecuteTask) [D:\BuildAgents\BuildServer\_work\1\s\Src\Project.Client\Project.Client.csproj]

#49 Added a Pull Request to resolve this issue. @stavroskasidis PLEASE accept soon as this is causing me major issues.

Fixed in 2.4.5 (pull request approved)

Thank you!