Earlier I was building and deploying web project using msbuild.exe
Now I want to modify some files before deploying, so I make a .zip package using msbuild, then unzip it, modify some files and then zip it again and try to deploy using msdeploy.
The problem is, that it deploys empty folder. When I try to deploy unmodified .zip package - it works fine.
After long hours digging, I figured out, that msdeploy does not support packages, which were zipped using other than built in windows zip archiver.
How to zip files using windows zip archiver in C#/F#? I've tried using System.IO.Compression.ZipFile.CreateFromDirectory
method, but msdeploy still deploys empty folders.
Here's the warning what I get, when trying to deploy package:
Warning: Skipping source dirPath (C:\TeamCity\buildAgent\MyPath) because of rule SkipInvalidSource.
The Zip package 'C:\TeamCity\buildAgent\MyPath\MyPackage.zip' could not be loaded.
When I disable SkipInvalidSource
rule, I get the following error:
Error: (12/23/2014 6:56:44 PM) An error occurred when the request was processed on the remote computer.
Error: Object reference not set to an instance of an object.
at Microsoft.Web.Deployment.DeploymentSyncEnumerable.<Create>d__0.MoveNext()
at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
at Microsoft.Web.Deployment.DeploymentSyncContext.SyncChildrenNoOrder(DeploymentObject dest, DeploymentObject source)
at Microsoft.Web.Deployment.DeploymentSyncContext.SyncChildrenNoOrder(DeploymentObject dest, DeploymentObject source)
at Microsoft.Web.Deployment.DeploymentSyncContext.SyncChildrenOrder(DeploymentObject dest, DeploymentObject source)
at Microsoft.Web.Deployment.DeploymentSyncContext.ProcessSync(DeploymentObject destinationObject, DeploymentObject sourceObject)
at Microsoft.Web.Deployment.DeploymentObject.SyncToInternal(DeploymentObject destObject, DeploymentSyncOptions syncOptions, PayloadTable payloadTable, ContentRootTable contentRootTable, Nullable`1 syncPassId, String syncSessionId) at Microsoft.Web.Deployment.DeploymentAgent.HandleSync(DeploymentAgentAsyncData asyncData, Nullable`1 passId)
Error count: 1.
Any ideas how to zip and deploy project correctly?
-dest:contentPath
rather than zipped package.