如何在svcutil.exe的命令行上指定CppCodeProvider?
我正在尝试使用 svcutil 从 XSD 生成托管 C++ 代码。我使用的命令行是
"C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\bin\xsd.exe" MyTest.xsd /classes /language:"Microsoft.VisualC.CppCodeProvider7, CppCodeProvider, Version =10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /namespace:MyTestApp
但是,我收到如下错误消息
Error: Value 'microsoft.visualc.cppcodeprovider7, cppcodeprovider, version=10.0.0.0,culture=neutral, publickeytoken=b03f5f7f11d50a3a ' 对于开关/语言无效。没有为该语言定义 codedom 提供程序。
我知道我已将 CppCodeProvider 作为 Visual Studio 安装的一部分进行安装。我也尝试过/语言:cpp,但无济于事。我能够在 C# 中生成代码,对于相同的 XSD 没有任何问题。
有谁知道我做错了什么?
I am trying to use svcutil to generate managed C++ code from XSD. The command line I am using is
"C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\bin\xsd.exe" MyTest.xsd /classes /language:"Microsoft.VisualC.CppCodeProvider7, CppCodeProvider, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /namespace:MyTestApp
However, I get error message as follows
Error: Value 'microsoft.visualc.cppcodeprovider7, cppcodeprovider, version=10.0.0.0, culture=neutral, publickeytoken=b03f5f7f11d50a3a' for switch /language is invalid. There is no codedom provider defined for the language.
I know that I have CppCodeProvider installed as part of Visual Studio install. I have also tried /language:cpp to no avail. I was able to generate code in C# without any issue for the same XSD.
Does anyone know what I am doing wrong?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
MSDN Library 文章中针对 svcutil.exe 明确指出:
我认为这是当时 .NET 2.0 SDK 附带的。否则这不是问题,从那时起语言就没有改变。为什么不使用csharp?能够在 .NET 中轻松地混合语言是它的一大优势。
It is clearly stated in the MSDN Library article for svcutil.exe:
I think that came with the .NET 2.0 SDK back then. Not otherwise a problem, the language hasn't changed since then. Why not use csharp? Being able to painlessly mix languages in .NET is one of its great assets.