MsDeploy could not create folder in bin directory - treats as file, according to log

0

I am trying to deploy simple zip archive to webroot of an application with following file only:

bin/Views/Test.cshtml

using following MsDeploy command

C:\Program Files\IIS\Microsoft Web Deploy V3\msdeploy.exe" -allowUntrusted="True" -verb:sync -source:package="package.zip" -dest:contentPath="test",includeAcls="False" -skip:objectName=dbFullSql -skip:objectName=dbDacFx -enableRule:DoNotDelete -enableRule:IgnoreFileLastWriteTime

But it fails with following error

Info: Adding file (test\bin\Views\).
Error: An error was encountered when processing operation 'Create File' on 'C:\inetpub\test\bin\Views\'.
Error: The error code was 0x8007007B.
Error: The path 'C:\inetpub\test\bin\Views\' is not valid.
Error count: 1.

Basing on error, I could suppose that MsDeploy somehow treats Views folder as file. How could I fix this?

msdeploy

1 Answer

0

Turns out that problem was in the way, how archive was created. I used following Powershell command:

Compress-Archive -Path $Src -DestinationPath $Dest -CompressionLevel Optimal -Force -Verbose -ErrorAction Stop

This was wrong, as it packed folders as files.

To fix this, I used following command:

Add-Type -Assembly "System.IO.Compression.FileSystem" ;
[System.IO.Compression.ZipFile]::CreateFromDirectory("$Src","$Dest")

And deployment started working


User contributions licensed under CC BY-SA 3.0