如何在svcutil.exe的命令行上指定CppCodeProvider?

发布于 2024-09-10 20:23:01 字数 624 浏览 2 评论 0原文

我正在尝试使用 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

一萌ing 2024-09-17 20:23:01

MSDN Library 文章中针对 svcutil.exe 明确指出:

/语言:<语言>

值:c#、cs、csharp、vb、
VisualBasic、C++、CPP

默认:csharp

缩写形式:/l

注意:该交换机仅支持C++
对于附带的代码提供程序
Visual Studio 2005 SP1。

我认为这是当时 .NET 2.0 SDK 附带的。否则这不是问题,从那时起语言就没有改变。为什么不使用csharp?能够在 .NET 中轻松地混合语言是它的一大优势。

It is clearly stated in the MSDN Library article for svcutil.exe:

/language:<language>

Values: c#, cs, csharp, vb,
visualbasic, c++, cpp

Default: csharp

Short form: /l

Note: The switch only supports C++
for the code provider that ships with
Visual Studio 2005 SP1.

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文