Search code examples
azuremsbuildazure-functionskudu

Azure Function CI Build Error - Cannot create a file when that file already exists


This issue is pretty straightforward, the functionapp fails to build with this one error. I found it interesting that it's stopping on the copy of a .pdb file. I've stopped and restarted the function app and ran "sync", no improvement.

"D:\home\site\repository\API.Routing\API.Routing.csproj" (default target) (1) ->
(_GenerateFunctionsPostBuild target) -> 
  D:\home\.nuget\microsoft.net.sdk.functions\1.0.0\build\netstandard1.0\Microsoft.NET.Sdk.Functions.Build.targets(26,5): error MSB3677: Unable to move file "D:\home\site\repository\API.Routing\bin\Release\net461\\API.Routing.pdb" to "D:\home\site\repository\API.Routing\bin\Release\net461\\bin\API.Routing.pdb". Cannot create a file when that file already exists. [D:\home\site\repository\API.Routing\API.Routing.csproj]

Solution

  • I updated the Microsoft.NET.Sdk.Functions nuget package in my project to v1.0.1, pushed the change to GIT, and now Azure Functions builds my project.