question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

.NET Core SDK/runtime Installer - The process cannot access the file because it is being used by another process

See original GitHub issue

Required Information

Entering this information will route you directly to the right team and expedite traction.

Question, Bug, or Feature?
Type: Bug

Enter Task Name: .NET Core SDK/runtime installer

Environment

Server: Azure Pipelines, Account Name: DLLGroup, Project Name: DLLGroup, Build Def: API-DUPS-Web-Api-Branches-and-topics

  • Agent - Hosted or Private: Hosted VS2017

Issue Description

We get sporadic build failure related to this task with the following error: `Exception calling “ExtractToDirectory” with “2” argument(s): “The process cannot access the file ‘D:\a_temp\a898b499-2079-446a-952e-26b06054db5c’ because it is being used by another process.” At line:1 char:111

  • … catch { } ; [System.IO.Compression.ZipFile]::ExtractToDirectory('D:\a …
  •             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : NotSpecified: (😃 [], ParentContainsErrorRecordException
    • FullyQualifiedErrorId : IOException

##[error]C:\windows\System32\WindowsPowerShell\v1.0\powershell.exe failed with return code: 1 `

Similar to issue reported within Issue 7692 albeit the issue reported in link is for On-Premise Agent.

Task logs

`Starting: Use .NET Core sdk 2.1.500

Task : .NET Core SDK/runtime installer Description : Acquire a specific version of the .NET Core SDK from the internet or local cache and add it to the PATH Version : 0.2.7 Author : Microsoft Corporation Help : https://docs.microsoft.com/azure/devops/pipelines/tasks/tool/dotnet-core-tool-installer

Tool to install: .NET Core sdk version 2.1.500. C:\windows\System32\WindowsPowerShell\v1.0\powershell.exe -NoLogo -Sta -NoProfile -NonInteractive -ExecutionPolicy Unrestricted -Command “& ‘D:\a_tasks\DotNetCoreInstaller_b0ce7256-7898-45d3-9cb5-176b752bfea6\0.2.7\externals\get-os-platform.ps1’” Primary:win-x64 Detected platform (Primary): win-x64 Checking if a cached copy exists for this version… The cache does not contain the requested version of .NET Core. Downloading and installing it now. Getting URL to download .NET Core sdk version: 2.1.500. (node:4472) Warning: Use Cipheriv for counter mode of aes-256-ctr (node:4472) Warning: Use Cipheriv for counter mode of aes-256-ctr (node:4472) Warning: Use Cipheriv for counter mode of aes-256-ctr (node:4472) Warning: Use Cipheriv for counter mode of aes-256-ctr (node:4472) Warning: Use Cipheriv for counter mode of aes-256-ctr (node:4472) Warning: Use Cipheriv for counter mode of aes-256-ctr (node:4472) Warning: Use Cipheriv for counter mode of aes-256-ctr (node:4472) Warning: Use Cipheriv for counter mode of aes-256-ctr (node:4472) Warning: Use Cipheriv for counter mode of aes-256-ctr (node:4472) Warning: Use Cipheriv for counter mode of aes-256-ctr (node:4472) Warning: Use Cipheriv for counter mode of aes-256-ctr (node:4472) Warning: Use Cipheriv for counter mode of aes-256-ctr (node:4472) Warning: Use Cipheriv for counter mode of aes-256-ctr (node:4472) Warning: Use Cipheriv for counter mode of aes-256-ctr (node:4472) Warning: Use Cipheriv for counter mode of aes-256-ctr (node:4472) Warning: Use Cipheriv for counter mode of aes-256-ctr (node:4472) Warning: Use Cipheriv for counter mode of aes-256-ctr (node:4472) Warning: Use Cipheriv for counter mode of aes-256-ctr Downloading: https://download.visualstudio.microsoft.com/download/pr/2a508a9d-91e8-4126-904c-f7a515f8a33b/24ff5fe2610ce1ce76370ed053b14094/dotnet-sdk-2.1.500-win-x64.zip Extracting downloaded package D:\a_temp\a898b499-2079-446a-952e-26b06054db5c. Extracting archive C:\windows\system32\chcp.com 65001 Active code page: 65001 C:\windows\System32\WindowsPowerShell\v1.0\powershell.exe -NoLogo -Sta -NoProfile -NonInteractive -ExecutionPolicy Unrestricted -Command “$ErrorActionPreference = ‘Stop’ ; try { Add-Type -AssemblyName System.IO.Compression.FileSystem } catch { } ; [System.IO.Compression.ZipFile]::ExtractToDirectory(‘D:\a_temp\a898b499-2079-446a-952e-26b06054db5c’, ‘D:\a_temp\5c123c0e-45d4-462a-9a52-e686608cefae’)” Exception calling “ExtractToDirectory” with “2” argument(s): “The process cannot access the file ‘D:\a_temp\a898b499-2079-446a-952e-26b06054db5c’ because it is being used by another process.” At line:1 char:111

  • … catch { } ; [System.IO.Compression.ZipFile]::ExtractToDirectory('D:\a …
  •             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : NotSpecified: (😃 [], ParentContainsErrorRecordException
    • FullyQualifiedErrorId : IOException

##[error]C:\windows\System32\WindowsPowerShell\v1.0\powershell.exe failed with return code: 1 Finishing: Use .NET Core sdk 2.1.500

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
vineetmimrotcommented, Apr 1, 2020

There is a drastic difference in the design of ver 0 and ver 2 of the task. Let’s wait for a week and reply to us if you face this issue again.

0reactions
anuragc617commented, Apr 7, 2020

Hi @frankkilcommins we are closing this, feel free to re-open if the issue is not resolved.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error the process cannot access the file because it is being ...
IOException: The process cannot access the file 'C:\logs\api.log' because it is being used by another process. at System.IO.FileStream.
Read more >
The file is locked by: .NET Core Host - Visual Studio Feedback
The process cannot access the file 'bin\Debug\netcoreapp3.0\Application.dll' because it is being used by another process. The file is locked by: “.NET Core ......
Read more >
FIX The Process Cannot Access the File Because It ... - YouTube
FIX The Process Cannot Access the File Because It Is Being Used by Another ProcessCommands Shown: net stop httpnet start httpSeveral Windows ...
Read more >
Troubleshoot .NET tool usage issues - Microsoft Learn
Could not execute because the specified command or file was not found. Possible reasons for this include: * You misspelled a built-in dotnet...
Read more >
dotnet/runtime - Gitter
IOException: The process cannot access the file '/app/build/Foo.deps.json' because it is being used by another process. in a docker build process is ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found