Search code examples
c++xmlvisual-studio-2015xml-bindingcodesynthesis

Compiling a valid XML Schema using CodeSynthesis XSD fails with Error MSB3721


I'm trying to use CodeSynthesis XSD (in Visual Studio 2015) for XML to C++ binding. I have a valid XML schema, but XSD fails to compile it. Here is the error message:

Error MSB3721 The command "xsd.exe cxx-tree --output-dir "." --hxx-suffix ".hxx" --cxx-suffix ".cxx" --ixx-suffix ".ixx" --fwd-suffix "-fwd.hxx"   projectSchema.xsd" exited with code 1.   

I have tried both the "xsd-cxx-parse" and the "xsd-cxx-tree" build options but they both fail with the same error.

I've tried to compile other schemas in the same project, including examples that come with the CodeSythesis XSD package, and they all successfully compile.

  • Are there any restrictions on what CodeSynthesis can or cannot compile? All of the schemas I've tested including mine are version 1.0 if that helps (and they're all valid).
  • Does anybody know what an Error MSB3721 exiting with code 1 means or how to resovle it?

Solution

  • Using xsd from the command line might give you more information about what's going wrong. There's also a number of switches that are possibly necessary for you to use, e.g. namespace-map if your schema uses one.