techtalk/SpecFlow — Issue #141: Can't run features in a Silverlight test project
Author: JonKruger
Created: 2011-10-26 15:38:37+00:00
State: open

If you try to run a feature in a Silverlight test project, you get the following error:

TechTalk.SpecFlow.Compatibility.ExceptionHelper+ScenarioErrorException: Exception thrown calling step StepDefinition2.GivenSomethingElse():
---> System.TypeAccessException: Attempt by method 'DynamicClass.lambda_method(System.Runtime.CompilerServices.Closure, TechTalk.SpecFlow.Infrastructure.IContextManager)' to access type 'System.RuntimeType' failed.
at lambda_method(Closure , IContextManager )
--- End of inner exception stack trace ---
at TechTalk.SpecFlow.Infrastructure.TestExecutionEngine.OnAfterLastStep()
at TechTalk.SpecFlow.TestRunner.CollectScenarioErrors()
at MyProject.AcceptanceTests.Features.AdditionFeature.ScenarioCleanup()
at MyProject.AcceptanceTests.Features.AdditionFeature.AddTwoNumbers(): Exception thrown calling step StepDefinition2.GivenSomethingElse():

My stack:
.NET 4
VS 2010 SP1
MSTest
Silverlight 4
AgUnit 0.4.2
ReSharper 6