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:


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?

  • I'm using the Partner and Metadata WSDL files. I've added them as a WebReference in my .NET project
    – cfann61
    Jun 13 '15 at 23:43
  • You can edit your own question for clarification, even when you can't edit any arbitrary question. I suggest you do so as an edit.
    – sfdcfox
    Jun 13 '15 at 23:54
  • 1
    @cfann61 Should the second paragraph be "If I deploy said package with deployOptions.singlePackage=**true**"? That, or it should be true in the third paragraph. Jun 14 '15 at 7:35

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.

  • When I structure the zip like this, I'm getting errors "An object xxxx of type CustomObject was named in package.xml, but was not found in zipped directory." I have unzipped the deploy.zip to check the contents, and it contains the .object files referenced.
    – cfann61
    Jun 15 '15 at 12:56
  • Try changing you package.xml file to use the * notation for each type. Then it will deploy exactly what is included in the zip file. Jun 16 '15 at 7:45

Assuming that all of the components listed in the package.xml file are in the directories, I'd say the solution is to set singlePackage to true.

There might be another error somewhere else, but when deploying unpackaged metadata to salesforce, in my experience, that value always needs to be set to true.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.