简体   繁体   English

如何从命令行将两个名称空间传递给XSDObjectGen?

[英]How do I pass two namespaces into XSDObjectGen from command line?

I'm trying to use XSDObjectGen as a PreBuild in Visual Studio 2008. 我正在尝试将XSDObjectGen用作Visual Studio 2008中的PreBuild。

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? 这是错误吗?

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: 此工具的更高版本上有一个选项/ y,您可以这样使用它:

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

This allows for passing in the extra namespace names. 这允许传递额外的名称空间名称。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何将命令行从WPF应用程序传递到另一个应用程序? - How do I pass command line from a WPF application to another application? 如何将命令行参数传递给 WinForms 应用程序? - How do I pass command-line arguments to a WinForms application? 如何从命令行将文件传递到程序 - How to pass file to the program from the command line 如何从WPF应用程序写入命令行? - How do I write to command line from a WPF application? 如何从代码运行命令行命令 - How do I run Command line commands from code 如何从命令行编译NuGet项目? - How do I compile a NuGet project from the command line? 如何从 web 应用程序运行命令行进程? - How do I run a command line process from a web application? C#当从不同的命名空间中使用两组“相同”类时,如何避免两次写入相同的方法? - C# When consuming two sets of “identical” classes from different namespaces, how do I avoid writing the same method(s) twice? 如何使用C#语法将DTEXEC实用工具命令行参数传递给process.start? - How do I pass DTEXEC utility command line arguments to process.start using C# syntax? 如何在Visual Studio Code或dotnet命令行的两个程序之间链接源文件? - How do I link a source file between two proejcts in Visual Studio Code or dotnet command line?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM