[Command Line] input xsd file path

Jan 10, 2011 at 1:13 PM
Edited Jan 10, 2011 at 1:14 PM

Hi There,

First of all, congratulations on a fantastic project - my eyes lit up when I found this, after a morning wrestling with xsd.exe :)

While Xsd2Code does a great job of generating code just the way I want it to, I am having some difficulty integrating it into my build process. My solution structure is like this:


-- [MySolution]
---- [MyProject]
------ [Build]
-------- Xsd2Code.exe -------- BuildSchema.bat ---- [Myproject.Schema]
------ MySchema.xsd


In MyProject pre build event I have:


cd $(SolutionDir)


So the pre-build calls the batch file (current dir is MySolution)


The batch file calls Xsd2Code.exe like so:


call MyProject\Build\Xsd2Code.exe MyProject.Schema\MySchema.xsd


However Xsd2Code does not appear to be getting that file path correctly, the error is:

error : Could not find a part of the path '[...]MyProject.Schema\MyProject.Schema\mySchema.xsd'.

As you can see, it's altered the path and added a second copy of the folder I passed in.

So, when passing a path into Xsd2Code, do I have to do anything differently? At the moment the only time I've successfully used Xsd2Code is when everything is in the same folder :(

I really hope I can get this working because Xsd2Code is really great and I never want to see xsd.exe again! heh