Error MSB4018 The "GenerateFeatureFileCodeBehindTask" task failed unexpectedly error

421 views
Skip to first unread message

Nick Kirby

unread,
Jan 13, 2020, 8:25:47 AM1/13/20
to SpecFlow
Hello all,

I've been following the Specflow tutorial to attempt to learn it yet I am seeing this error:

Error    MSB4018    The "GenerateFeatureFileCodeBehindTask" task failed unexpectedly.
System.Exception: Unit test Provider already set. 

when I build the solution. It's probably an error on my part but I am new to the tool and not sure where to look.

I would be very grateful if someone could point me in the right direction.

I am using Visual studio 2017. I include a list of the packages I have added as dependencies (I'm not sure if this is helpful or not) .

I'm new to this so please 'Janet and John' for a novice.

Thank you for your assistance.
Screenshot 2020-01-13 at 13.24.15.png

Andreas Willich

unread,
Jan 13, 2020, 8:32:35 AM1/13/20
to SpecFlow
Hi

You get this error because you have SpecFlow.MSTest and the SpecRun.SpecFlow package installed.
Since SpecFlow 3.0 we configure the unit test provider via NuGet packages.

You can only have one of the two packages installed. It depends which unit test provider you want to use.

Best Regards
Andi

--
You received this message because you are subscribed to the Google Groups "SpecFlow" group.
To unsubscribe from this group and stop receiving emails from it, send an email to specflow+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/specflow/14d5066e-66ff-4cd4-9bba-49ffaa41ae9e%40googlegroups.com.

Nick Kirby

unread,
Jan 15, 2020, 7:46:08 AM1/15/20
to SpecFlow
Hello Andreas,

Many thanks for your advice, I've removed the unnecessary package and my test now appears in test explorer.

I've another issue with it being skipped, but that's a different matter.

Thanks to everyone who gave advice,


Reply all
Reply to author
Forward
0 new messages