代码之家  ›  专栏  ›  技术社区  ›  Sudama Tripathi

无法使用vstest运行specflow测试。安慰exe文件

  •  1
  • Sudama Tripathi  · 技术社区  · 7 年前

    我正试着跑步 speflow vsts . 我正在使用以下内容 VST 测试运行程序任务:

    C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\CommonExtensions\Microsoft\TestWindow\vstest.console.exe myassembly.dll
    

    有关详细信息,请检索LoaderExceptions属性。

    /TestAdapterPath: "Adapterpath"/UseVsixExtensions:True/False(Both option)/Platform:[ platform type ] 
    

    1 回复  |  直到 4 年前
        1
  •  1
  •   Sudama Tripathi    7 年前

    下面几行代码帮助我识别了缺失的dll,现在它是需要修复的构建。

    try
        {
        }
        catch (System.Reflection.ReflectionTypeLoadException ex)
        {
            System.Text.StringBuilder sb = new System.Text.StringBuilder();
            foreach (System.Exception exSub in ex.LoaderExceptions)
            {
                sb.AppendLine(exSub.Message);
                System.IO.FileNotFoundException exFileNotFound = exSub as System.IO.FileNotFoundException;
                if (exFileNotFound != null)
                {
                    if (!string.IsNullOrEmpty(exFileNotFound.FusionLog))
                    {
                        sb.AppendLine("Fusion Log:");
                        sb.AppendLine(exFileNotFound.FusionLog);
                    }
                }
                sb.AppendLine();
            }
            string errorMessage = sb.ToString();
            throw new System.Exception(errorMessage);
        }