Build Error - Error copying following files to bin\debug
See original GitHub issueI encounter following errors while trying to build the solution from command line build.cmd and from here on i couldn’t follow the setup instruction any further.
C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targ
ets(4560,5): error MSB3027: Could not copy "D:\FLProjects\AspNetCore-master\AspNetCore\src\Mvc\Mvc.Api.Analyzers\test\T
estFiles\ApiActionsDoNotRequireExplicitModelValidationCheckAnalyzerIntegrationTest\NoDiagnosticsAreReturned_ForApiActio
nsReturning400FromNonModelStateIsValidBlocks.cs" to "bin\Debug\netcoreapp3.0\TestFiles\ApiActionsDoNotRequireExplicitMo
delValidationCheckAnalyzerIntegrationTest\NoDiagnosticsAreReturned_ForApiActionsReturning400FromNonModelStateIsValidBlo
cks.cs". Exceeded retry count of 10. Failed. [D:\FLProjects\AspNetCore-master\AspNetCore\src\Mvc\Mvc.Api.Analyzers\tes
t\Mvc.Api.Analyzers.Test.csproj]
C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targ
ets(4560,5): error MSB3021: Unable to copy file "D:\FLProjects\AspNetCore-master\AspNetCore\src\Mvc\Mvc.Api.Analyzers\t
est\TestFiles\ApiActionsDoNotRequireExplicitModelValidationCheckAnalyzerIntegrationTest\NoDiagnosticsAreReturned_ForApi
ActionsReturning400FromNonModelStateIsValidBlocks.cs" to "bin\Debug\netcoreapp3.0\TestFiles\ApiActionsDoNotRequireExpli
citModelValidationCheckAnalyzerIntegrationTest\NoDiagnosticsAreReturned_ForApiActionsReturning400FromNonModelStateIsVal
idBlocks.cs". Could not find a part of the path 'bin\Debug\netcoreapp3.0\TestFiles\ApiActionsDoNotRequireExplicitModelV
alidationCheckAnalyzerIntegrationTest\NoDiagnosticsAreReturned_ForApiActionsReturning400FromNonModelStateIsValidBlocks.
cs'. [D:\FLProjects\AspNetCore-master\AspNetCore\src\Mvc\Mvc.Api.Analyzers\test\Mvc.Api.Analyzers.Test.csproj]
C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targ
ets(4560,5): error MSB3027: Could not copy "D:\FLProjects\AspNetCore-master\AspNetCore\src\Mvc\Mvc.Api.Analyzers\test\T
estFiles\ApiActionsDoNotRequireExplicitModelValidationCheckAnalyzerIntegrationTest\NoDiagnosticsAreReturned_ForApiActio
nsReturningNot400FromNonModelStateIsValidBlock.cs" to "bin\Debug\netcoreapp3.0\TestFiles\ApiActionsDoNotRequireExplicit
ModelValidationCheckAnalyzerIntegrationTest\NoDiagnosticsAreReturned_ForApiActionsReturningNot400FromNonModelStateIsVal
idBlock.cs". Exceeded retry count of 10. Failed. [D:\FLProjects\AspNetCore-master\AspNetCore\src\Mvc\Mvc.Api.Analyzers
\test\Mvc.Api.Analyzers.Test.csproj]
C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targ
ets(4560,5): error MSB3021: Unable to copy file "D:\FLProjects\AspNetCore-master\AspNetCore\src\Mvc\Mvc.Api.Analyzers\t
est\TestFiles\ApiActionsDoNotRequireExplicitModelValidationCheckAnalyzerIntegrationTest\NoDiagnosticsAreReturned_ForApi
ActionsReturningNot400FromNonModelStateIsValidBlock.cs" to "bin\Debug\netcoreapp3.0\TestFiles\ApiActionsDoNotRequireExp
licitModelValidationCheckAnalyzerIntegrationTest\NoDiagnosticsAreReturned_ForApiActionsReturningNot400FromNonModelState
IsValidBlock.cs". Could not find a part of the path 'bin\Debug\netcoreapp3.0\TestFiles\ApiActionsDoNotRequireExplicitMo
delValidationCheckAnalyzerIntegrationTest\NoDiagnosticsAreReturned_ForApiActionsReturningNot400FromNonModelStateIsValid
Block.cs'. [D:\FLProjects\AspNetCore-master\AspNetCore\src\Mvc\Mvc.Api.Analyzers\test\Mvc.Api.Analyzers.Test.csproj]
C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targ
ets(4560,5): error MSB3027: Could not copy "D:\FLProjects\AspNetCore-master\AspNetCore\src\Mvc\Mvc.Api.Analyzers\test\T
estFiles\ApiConventionAnalyzerIntegrationTest\DiagnosticsAreReturned_IfAsyncMethodReturningValueTaskWithProducesRespons
eTypeAttribute_ReturnsUndocumentedStatusCode.cs" to "bin\Debug\netcoreapp3.0\TestFiles\ApiConventionAnalyzerIntegration
Test\DiagnosticsAreReturned_IfAsyncMethodReturningValueTaskWithProducesResponseTypeAttribute_ReturnsUndocumentedStatusC
ode.cs". Exceeded retry count of 10. Failed. [D:\FLProjects\AspNetCore-master\AspNetCore\src\Mvc\Mvc.Api.Analyzers\tes
t\Mvc.Api.Analyzers.Test.csproj]
C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targ
ets(4560,5): error MSB3021: Unable to copy file "D:\FLProjects\AspNetCore-master\AspNetCore\src\Mvc\Mvc.Api.Analyzers\t
est\TestFiles\ApiConventionAnalyzerIntegrationTest\DiagnosticsAreReturned_IfAsyncMethodReturningValueTaskWithProducesRe
sponseTypeAttribute_ReturnsUndocumentedStatusCode.cs" to "bin\Debug\netcoreapp3.0\TestFiles\ApiConventionAnalyzerIntegr
ationTest\DiagnosticsAreReturned_IfAsyncMethodReturningValueTaskWithProducesResponseTypeAttribute_ReturnsUndocumentedSt
atusCode.cs". Could not find a part of the path 'bin\Debug\netcoreapp3.0\TestFiles\ApiConventionAnalyzerIntegrationTest
\DiagnosticsAreReturned_IfAsyncMethodReturningValueTaskWithProducesResponseTypeAttribute_ReturnsUndocumentedStatusCode.
cs'. [D:\FLProjects\AspNetCore-master\AspNetCore\src\Mvc\Mvc.Api.Analyzers\test\Mvc.Api.Analyzers.Test.csproj]
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (5 by maintainers)
Top Results From Across the Web
Unable to copy a file from obj\Debug to bin\Debug
This should work. Go to your project properties. Inside Build Events, under Pre-build event command line, add these two lines of code:
Read more >Could not copy the file "obj\x64\Debug\Management.exe" ...
Hello, few times in day I get error “Could not copy the file “obj\x64\Debug\Management.exe” because it was not found.” while i try to...
Read more >Error copying following files to bin\debug · Issue #10693
I encounter following errors while trying to build the solution from command line build.cmd and from here on i couldn't follow the setup ......
Read more >MSB3021: Unable to copy file 'source' to 'destination'.
Common causes include the file is locked by another process, insufficient permissions to write to the destination folder, insufficient space on ...
Read more >[SOLVED] Unable to copy a file from obj - Winform Visual Studio
Unable to copy a file from obj \ Debug to bin \ Debug - Stack Overflow ... Visual Studio "Could not copy "...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

@natemcmaster it should call out in the setup that building will more than likely generate a MAX_PATH exception if it is is nested folder. Guidance should be to clone the repo off the root of the disk (for Windows at least)
@mkArtakMSFT
https://github.com/aspnet/AspNetCore/blob/master/docs/BuildFromSource.md
instructions i am following are in this link and i have download the source code from code tab
https://github.com/aspnet/AspNetCore
cloned it following instructions using git and everything somehow i figured out until the point where it was mentioned in instructions to run build.cmd i have tried to restart PC thinking maybe some services causing this, updated the visual studio 2019 as well and installed visual studio too from powershell link provided in instruction but i still get these 6 errors