在C#项目中使用XSD Build任务 [英] Use XSD Build task in c# project

查看:87
本文介绍了在C#项目中使用XSD Build任务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用c ++ XSD任务在ac#项目中?我已经像这样在csproj文件中创建了任务:

How can I use the c++ XSD Task in a c# project? I have already created the task in the csproj file like this:

  <Target Name="BeforeBuild">
    <XSD Namespace="$(RootNamespace).Xml" Language="CS" GenerateFromSchema="classes" Sources="Xml/schema.xsd" />
  </Target>

但是构建输出显示,尽管intellisense在编辑项目文件时为我提供了XSD任务:

but the build output says, although intellisense offers me the XSD task while editing the project file:

Error   1   The "XSD" task was not found. Check the following: 
1.) The name of the task in the project file is the same as the name of the task class. 
2.) The task class is "public" and implements the Microsoft.Build.Framework.ITask interface. 3.) The task is correctly declared with <UsingTask> in the project file, or in the *.tasks files located in the "C:\Windows\Microsoft.NET\Framework\v4.0.30128" directory. MyProject.csproj

哦,我正在使用Visual Studio 2010 RC.

Oh, and I am using Visual Studio 2010 RC.

*

推荐答案

忘了C ++位,这与msdn页面标题无关.该工具称为 XML架构定义工具(Xsd.exe ),以及用于创建模式或代码的

Forget the C++ bit, it's a distraction from the msdn page title. The tool is called XML Schema Definition Tool (Xsd.exe), and its for creating schema or code.

要进一步调试,请将您的msbuild日志记录级别设置为/versbosity:diagnostic ,然后查看哪些标头(导入的MSBUILD任务定义已导入).

To debug further please set your msbuild logging level to /versbosity:diagnostic and see what headers (imported MSBUILD task definitions its pulling in).

这篇关于在C#项目中使用XSD Build任务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆