Ho il seguente codice in C#:Come posso correggere l'errore: "Il currentthread deve avere il suo stato di appartamento impostato su ApartmentState.sta per poter avviare Internet Explorer"?
namespace Tests
{
[SetUpFixture, RequiresSTA]
public class Setup
{
public IE Window = new IE("webpage");
[SetUp]
public void SetUp()
{
}
[TearDown]
public void TearDown()
{
}
}
}
Quando provo a farlo funzionare con il mio sito web restituisce l'errore:
"The currentthread needs to have its apartmentstate set to ApartmentState.sta to be able to initiate Internet Explorer"
Normalmente quando si utilizza nulla, tranne SetupFixture, RequiresSTA la soluzione. Ma per qualche motivo non funziona ora.