Question

I'm trying to use XSDObjectGen as a PreBuild in Visual Studio 2008.

I can run it on the command line:

XSDObjectGen\XSDObjectGen.exe  AnalyticsDomainModel.xsd /l:cs /d /p /n:AdaptorAnalyticDomainModel.Primatives /n:AdaptorAnalyticDomainModel /f:AnalyticDomainModel

This then prompts for me to type two names spaces:

Imported namespaces were found.  Please enter valid .NET namespace names for each namespace.
WARNING. Namespaces chosen must not conflict with types and element names from the schemas.
Xsd namespace = http://sempra.com/schema/adm/primatives/1.0. Please enter a CLR namespace name for this namespace:  AdaptorDomainModel.Primatives
Xsd namespace = http://sempra.com/schema/adm/1.0. Please enter a CLR namespace name for this namespace:  AdaptorDomainModel
Done. Success
Writing file  AdaptorDomainModel.cs.
Writing file  AdaptorDomainModel.Primatives.cs.

an I have to type the bits after "namespace:". Because it requires me to enter the name spaces manually I can't automate the process.

How do I pass in the two arguments on the command line? Is this a bug?

Was it helpful?

Solution

I found the answer.... maybe you'll have the same problem and want the solution. So here it is.

There is an option on the later version of this tool called /y you use it like so:

XSDObjectGen\XSDObjectGen.exe  AnalyticsDomainModel.xsd /l:cs /d /p /n:dummy /y:"AdaptorAnalyticDomainModel.Primatives|AdaptorAnalyticDomainModel"

This allows for passing in the extra namespace names.

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