.net - SpecFlowPlusRunnerAssemblyHook 抛出异常 Invalid URI: The hostname could not be parsed
问题描述
我正在将 SpecFlow 与 .net 3.1 应用程序一起使用。当我运行/调试测试时,我在一些非常深的 dll 中不断出现错误。它似乎与 ConfigurationManager 相关。
2021-11-02T09:12:27.7102541-06:00:2021-11-02T09:12:27.7100969-06:00:Assembly 解析 System.Private.Uri.resources, Version=4.0.6.0, Culture=en, PublicKeyToken= b03f5f7f11d50a3a 2021-11-02T09:12:27.7366747-06:00:2021-11-02T09:12:27.7357023-06:00:OutOfProcessTestAssemblyExecutor:RunTest 错误:System.Configuration.ConfigurationErrorsException:配置系统初始化失败---> 系统.UriFormatException:无效的 URI:无法解析主机名。在 System.Uri.CreateThis(String uri, Boolean dontEscape, UriKind uriKind) 在 System.Configuration.ClientConfigPaths..ctor(String exePath, Boolean includeUserConfig) 在 System.Configuration.ClientConfigPaths 在 System.Uri..ctor(String uriString)。 GetPaths(String exePath, Boolean includeUserConfig) 在 System.Configuration.ClientConfigurationHost.get_ConfigPaths() 在 System.Configuration。
另一个症状是测试被跳过。我已经调试了源代码,这似乎是一个路径问题,但我找不到有关 System.Configuration.ClientConfigurationSystem 库的任何文档。
解决方案
将项目移动到较小的路径似乎是解决方法。网址中可能有一些不好的东西C:\Users\mynamee\source\repos\tfs\SomesProjMicroservices\TestAutomation\BRAN\AB.RSS.SomesProj.Microservices.TestAutomation\AB.RSS.Microservices.Common.Tests\Steps\SomereallyLongClasname
推荐阅读
- wix - Wix bootsrapper 成功窗口上的复选框
- r - 在 mutate_at 中使用粘贴添加到列
- php - Php 不会从 JSON 到 MySQL 一次插入或 ON DUPLICATE KEY UPDATE
- android - 当我输入正确的用户名和密码时,我的应用程序崩溃了
- amazon-web-services - Terraform:无法指定加密标志,因为设备 /dev/sda1 已指定快照
- matlab - Matlab网格步骤
- android - Xamarin Forms Android 目标 API 级别警告
- bash - 持续集成管道失败:退出并显示代码 1
- android - 如何使 Android FCM 通知服务始终在后台运行?
- php - 通过php在关联数组上搜索重复项