[SalesForce] .NET, CustomObject named in package.xml but was not found in zipped directory

I have successfully retrieved my package with the metadata api.

If I deploy said package with deployOptions.singlePackage=false, I get a successful deployment, with 0 components deployed. I've also done this with minor changes to an .object file ( added a custom field ) to test changes. Still 0 components deployed, no changes to org.

With singlePackage=true, I get errors of "CustomObject xxxxx was specified in package.xml but was not found in the zipped directory".

Since I packaged the retrieved components in the same directory structure that was retrieved, I would have expected it to be successful. I have also tried other directory structures.

The retrieved directory structure that I zipped and tried to deploy was:

/unpackaged
   package.xml
   /objects
   /permissionsets

with xml files in /objects and /permissionsets. Is this the correct zip directory structure? I'm using .net Compression.Zipped.Create to zip. The source for the zip function is a folder which contains /unpackaged, which results in the zip containing the unpackaged directory.

I'm pretty much stuck with this deploy function. Any suggestions? Would the create(), update() functions be easier to use?

Best Answer

The zip file (bytes) that you pass to the deploy method should not contain the /unpackaged folder. package.xml, /objects, and /permissionsets should be in the root of the zip.

You should also set singlePackage to true.