Aspnetcore: Build Error - Error copying following files to bin\debug

Created on 31 May 2019  路  6Comments  路  Source: dotnet/aspnetcore

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 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]
Duplicate area-infrastructure question

All 6 comments

Thanks for contacting us, @waqas1430.

Can you please be specific (drop the link here) which instructions you were following and which solution you're trying to build?

@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

Having same issue as well

Looks like https://github.com/aspnet/AspNetCore/issues/9431. MAX_PATH 馃檮 The build is trying to copy to
D:FLProjectsAspNetCore-masterAspNetCoresrcMvcMvc.Api.AnalyzerstestbinDebugnetcoreapp3.0TestFilesApiConventionAnalyzerIntegrationTestDiagnosticsAreReturned_IfAsyncMethodReturningValueTaskWithProducesResponseTypeAttribute_ReturnsUndocumentedStatusCode.cs which exceeds the 260 limit by 4.

@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)

Resolving this as a dupe of the referenced issue, where we track the fix for the MAx_PATH issue.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

glennc picture glennc  路  117Comments

danroth27 picture danroth27  路  130Comments

zorthgo picture zorthgo  路  136Comments

davidfowl picture davidfowl  路  126Comments

oliverjanik picture oliverjanik  路  91Comments