首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >FxCopCmd参数编码问题

FxCopCmd参数编码问题
EN

Stack Overflow用户
提问于 2011-02-21 01:03:02
回答 1查看 597关注 0票数 1

问题:

我需要在我的代码中使用FxCopCmd.exe (FxCop 10.0),我的问题是,我相信FxCopCmd通过一些编码问题来获取我的参数(参见下面的p.StartInfo.Arguments)。(我没有编码或本地化方面的经验。)

示例:

我建立的参数:

Visual Studio 2010\Projects\TeaBoiler\TeaBoiler\bin\Release\TeaBoiler.exe“:”C:\Users\Users\Documents\ /o:"C:\Users\Ákos\Documents\Tanulás\diplomamunka\softwareprojectqualityanalyser\implementáció\Analizer\Analizer\bin\Debug\temp\probaAnalisisReport.xml“/fo /f

FxCopCmd错误消息:

无法打开输出文件:找不到路径C:\Users\µkos\Documents\Tanul s\diplomamunka\softwareprojectqualityanalyser\implement和ci˘\Analizer\Analizer\bin\Debug\temp\probaAnalisisReport.xml‘..的一部分

注意:

如果我使用cmd.exe中的FxCopCmd.exe,并使用我通过编辑/粘贴构建的参数,它可以正常工作。

开发环境:

C# 7教授EN,默认输入语言:匈牙利语、.NET 4.0、Windows 4.0、VS2010旗舰版

代码:

代码语言:javascript
复制
using (Process p = new Process())
        {
            p.StartInfo.UseShellExecute = false;
            p.StartInfo.RedirectStandardInput = true;
            p.StartInfo.RedirectStandardOutput = true;
            p.StartInfo.RedirectStandardError = true;
            p.StartInfo.CreateNoWindow = true;
            p.StartInfo.FileName = this.FxCop10Path.LocalPath;

            string fullpath = Assembly.GetExecutingAssembly().Location;
            string dir = Path.GetDirectoryName(fullpath);

            p.StartInfo.Arguments = "/o:\"" + dir + "\\temp\\" +
                (this.ProjectName.Equals("") == true || this.ProjectName == null
                ? "noNameProjectAnalysisReport.xml" : this.ProjectName + "AnalisisReport.xml\"")
                + " /fo";
            foreach (var item in this.Files)
            {
                p.StartInfo.Arguments += " /f:\"" + item.FilePath + "\"";
            }
            try
            {
                p.Start();
            }
            catch (Win32Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }

谢谢你的帮助!

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2011-02-23 04:58:24

尝试在设置参数后立即中断。查看它正在生成的内容,然后将其复制并粘贴到cmd窗口中,看看发生了什么。另外,'temp‘文件夹是否存在?如果不是,您确定是FxCop创建的文件夹吗?

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/5058510

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档