I have a build step on TeamCity, that builds a project file and deploys the project to a network location. //server/system/Web
When the web folder does not exist, the deployment works fine, however, if the web folder already exists, the web folder is just deleted and the build fails.
Is there a flag I need to set, so msbuild just replaces the content, if there is anything there. I have also considered a powershell script that removes all content from the folder, before deploying, is this a viable solution?
LOG:
[12:20:18][MSBuild output] CopyAllFilesToSingleFolderForMsdeploy:
[12:20:18][MSBuild output] Creating directory "\server\system\web".
[12:20:18][MSBuild output] Copying all files to temporary location below for package/publish:
[12:20:18][MSBuild output] \server\system\web.
[12:20:18][MSBuild output] Copying bin\Dokumentproduksjon.Web.dll to \server\system\web\bin\Dokumentproduksjon.Web.dll.
[12:20:18][MSBuild output] Create Folder \server\system\web\bin failed. Access to the path '\server\system\web\bin' is denied.
[12:20:18][MSBuild output] Done Building Project "C:\TeamCity\buildAgent\work\ac656796ad82c0\Dokumentproduksjon.Web\Dokumentproduksjon.Web.csproj.teamcity" (Build;Package target(s)) -- FAILED.
[12:20:18][MSBuild output]
[12:20:18][MSBuild output] Build FAILED.