0
votes

I use Selenium tests in project. I add Selenium.WebDriver.ChromeDriver package from NuGet which download file chromedriver.exe and copy it to bin. But during building the project teamcity have problem with copy exe file.

Team City Build Agent is log on as Local System Account

[Web.UI.Tests\Web.UI.Tests.csproj] _CopyOutOfDateSourceItemsToOutputDirectory (1s) [11:17:37][_CopyOutOfDateSourceItemsToOutputDirectory] Copy

[Copy] Copying file from "C:\dev\TeamCity\buildAgent\work\2e8e0deca33dd11e\packages\Selenium.WebDriver.ChromeDriver.2.10.0.0\content\chromedriver.exe" to "bin\Release\chromedriver.exe".

[Copy] C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(3683, 5): error MSB3021: Unable to copy file "C:\dev\TeamCity\buildAgent\work\2e8e0deca33dd11e\packages\Selenium.WebDriver.ChromeDriver.2.10.0.0\content\chromedriver.exe" to "bin\Release\chromedriver.exe". Access to the path 'bin\Release\chromedriver.exe' is denied.

[Web.UI.Tests\Web.UI.Tests.csproj] Project Web.UI.Tests\Web.UI.Tests.csproj failed.

1

1 Answers

0
votes

I'd recommend using a tool like Unlocker to check what process is blocking the file from copying. But the most possible suggestion in this case would be checking your antivirus/Windows Defender or whatever tool is monitoring your files for threats. So what is possibly happening is NuGet downloading the .exe file and a background process is starting scanning it because any .exe file is suspicious for them. It might take a couple of seconds as chromedriver.exe has a decent size and that's why it is locked when it comes to copying this file.