我在 C# 中有以下代码:
namespace Tests
{
[SetUpFixture, RequiresSTA]
public class Setup
{
public IE Window = new IE("webpage");
[SetUp]
public void SetUp()
{
}
[TearDown]
public void TearDown()
{
}
}
}
当我尝试在我的网站上运行它时,它返回错误:
“当前线程需要将其公寓状态设置为 ApartmentState.sta 才能启动 Internet Explorer”
通常,当使用除 SetupFixture 之外的任何东西时,需要 STA 解决方案。但由于某种原因,它现在不起作用。