- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我的单元测试套件立即未能通过测试运行 System.DllNotFoundException: Unable to load DLL 'SQLite.Interop.dll'
这是测试中所需的依赖项 [AssemblyInitialize]
方法。
我确定这是由执行任何使用 [DeploymentItem]
的测试引起的属性,对于类或方法都是如此。任何不使用此属性的测试都会通过。
在 VS2019 中启用测试诊断日志记录后,没有明显的错误,但我可以看到此配置。
<RunSettings>
<RunConfiguration>
<ResultsDirectory>D:\Dev\****\src\TestResults</ResultsDirectory>
<SolutionDirectory>D:\Dev\****\src\</SolutionDirectory>
<TargetPlatform>X86</TargetPlatform>
<CollectSourceInformation>False</CollectSourceInformation>
</RunConfiguration>
</RunSettings>
我的测试项目都是为<PlatformTarget>AnyCPU</PlatformTarget>
配置的所以我想知道 SQLite.Interop.dll
是否未找到,因为 x86 与 x64 存在问题。
<RunSettings>
?SQLite.Interop.dll
找不到?更新
使用 procmon.exe
过滤 testhost.exe
和 SQLite.Interop.dll
我可以看到没有 [DeploymentItem]
的测试属性开始寻找项目中的dll bin\Debug
在 bin\Debug\x64\SQLite.Interop.dll
找到它的文件夹.
那些具有属性的测试开始在测试结果目录中查找 TestResults\...\Out
然后全机C:\Windows
, C:\Program Files
, C:Users
但再也不会低于bin\Debug
.
使用 VSTest.Console.exe
运行相同的测试没有这个问题。
.\Out
单元测试的目录?最佳答案
解决;
<DisableAppDomain>True</DisableAppDomain>
, 请参阅 Configure a test run 请注意,运行设置不能保留在项目或解决方案级别,需要在IDE中设置; https://developercommunity.visualstudio.com/content/problem/151608/ability-to-set-runsettings-in-project-file.html
关于MSTest DeploymentItem 属性导致找不到 SQLite.Interop.dll,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57780371/
我正在使用 Microsoft.Office.Interop.Outlook 提取电子邮件附件: var MAPI = new Application().GetNamespace("MAPI");
突然得到一个 System.invalidcastexception: unable to cast COM object of type 'system._object' to interface
我正在尝试在兼容的渲染目标上使用 Gdi 和 Direct 2D 来渲染位图。我使用 D2D1_COMPATIBLE_RENDER_TARGET_OPTIONS_GDI_COMPATIBLE 选项创建
完整错误: Could not load file or assembly 'Interop.Microsoft.Office.Interop.Word' or one of its dependen
我正在尝试寻找一种使用 Office.Interop.Outlook COM 对象连接到其他邮箱的方法。目前我正在执行以下操作(在添加 COM 对象之后): var app = new Microso
我有一个用 C# 编写的应用程序,该应用程序当前向 LDAP 进行身份验证。我们希望扩展功能以支持 IBM 的 Tivoli Access Manager,它由一个策略服务器和一个 LDAP 服务器(
在 Visual Studio 中将 interop.excel 引用添加到我的 C# winform 后,我无法再“编辑并继续”...... 错误提示“正在修改“方法” ' 包含嵌入式互操作类型/成
我正在尝试创建 Excel 文件的 Worksheet 数组,但找不到正确的转换。 这是代码: Excel.Application app = new Excel.Application(); Exc
我正在使用 C# Interop 从工作表中获取一些值,但出现以下错误: Non-invocable member 'Microsoft.Office.Interop.Excel.Range.End'
我在 MVC 桌面应用程序中使用 Nuget 包 System.Data.SQLite。当我尝试清理解决方案时出现错误。我收到的错误消息是:无法删除文件“...bin\Debug\x64\SQLite
序列化异常:程序集“Microsoft.Office.Interop.Excel,Version=11.0.0.0,Culture=neutral,PublicKeyToken=71e9bce111e
我正在通过命令行将 magento 2.1.8 升级到 2.3.3,当我运行 composer update 命令时它显示以下错误。 包 container-interop/container-int
我正在尝试从 C# 控制台应用程序中的 Excel 中捕获一些数据。 我得到了错误 Unable to cast COM object of type 'microsoft.Office.Intero
我收到一个错误: Unable to cast COM object of type 'Microsoft.Office.Interop.Excel.ApplicationClass' to inte
我刚刚下载了 MS Visual Studio 2010 解决方案并收到该错误。 Error 1 Assembly 'Microsoft.Office.Interop.Word, Version=15
我尝试为 socket.io 编写一个绑定(bind)。 我在使用函数(底部示例代码中的 next())时遇到问题,该函数要么不带参数,要么带有错误对象( Js.Exn.raiseError("ERR
在 C++/CLI 中,是否可以固定不包含元素的数组? 例如 array^ bytes = gcnew array(0); pin_ptr pin = &bytes[0]; //。您可以回退到 GCH
我目前正在从事一个项目,该项目包含几种不同的“编程”语言,每种语言都有自己的命名约定。应该始终使用相同的命名约定,还是应该在每种语言中使用不同的名称以具有原生外观(即不与框架的其余部分冲突)? 例如,
我是Clojure和Java的新手。 为了访问Clojure中的Java字段,您可以执行以下操作: Classname/staticField 就是一样的 (. Classname staticFie
我想提取word文档中的项目符号信息。我想要这样的东西:假设下面的文字在 word 文档中: 启动汽车的步骤: 开门 坐在里面 关上门 插入 key 等等 然后我想要我的文本文件如下: 启动汽车的步骤
我是一名优秀的程序员,十分优秀!