【发布时间】:2015-10-28 09:07:53
【问题描述】:
我目前正在使用 XSD.exe 工具来获取 XSD 文件的类。 但是当我将文件传递给工具时,它会更改路径/文件。
string fileName = "C:\\TEST\\testFILE.xsd";
Process p = new Process();
p.StartInfo = new ProcessStartInfo("C:\\xsd.exe", "/c /language:CS " + fileName);
p.StartInfo.RedirectStandardOutput = true;
p.StartInfo.RedirectStandardError = true;
p.StartInfo.UseShellExecute = false;
p.Start();
StringBuilder error = new StringBuilder();
while (!p.HasExited)
error.Append(p.StandardError.ReadToEnd());
MessageBox.Show(error.ToString());
这是向您展示问题的一些示例代码。 输出如下:
Error: Could not find file "c:\test\testfile.xsd
当然没有这样的文件或目录。 大家有什么办法解决这个问题吗?
谢谢 ;)
【问题讨论】:
-
我认为文件不存在并不明显。你指的是小写翻译吗?您是否尝试过在不使用 c++ 的情况下直接调用 xsd.exe?