Question

I have a build that needs to zip a website project. I am using TfsBuildExtensions.Activities.Compression.Zip to do this.

Unfortunately, it puts the deployed files into ..\_PublishedWebsites\ProjectName\. So, I have tried to play around with the RemoveRoot property, in the ZIP extension.

If I use the following value: (New DirectoryInfo(BinariesDirectory & "\_PublishedWebsites")).FullName my zip file contains the ProjectName folder and it then contains the website. Working as intended.

If I use the following value: (New DirectoryInfo(BinariesDirectory & "\_PublishedWebsites")).GetDirectories().FirstOrDefault().FullName my zip file contains the ENTIRE folder structure, from C:\Builds\... This is definitely not what I expected.

All I want, is that instead of having a folder in my zip, I want the deployed files directly in the zip files root.

How do I do this?

Was it helpful?

Solution

Web Deploy should be your first choice for packaging web sites. It has a built-in option for zipping the artifacts so you don't need any third-party libraries for this.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top