Installation - SpecsFor

Posted in General by Roger Mantews Wed Feb 17 2016 15:17:24 GMT+0000 (Coordinated Universal Time)·6·Viewed 1,018 times

Hi Matt: I've spent a frustrating couple of hours trying to install SpecsFor on a new test project in Visual Studion 2015. It first gave me the error that Moq or one of the dependencies was not the same one referenced in the assembly. I then ran the command Add-BindingRedirect in the package manager for the test project. Now I'm getting the message that SetUp : SpecsFor.WhenSpecificationException : An error occurred during the spec 'When' phase. -------------------------------------------------------------------- System.InvalidOperationException: No Entity Framework provider found for the ADO.NET provider with invariant name 'System.Data.SqlClient'. Make sure the provider is registered in the 'entityFramework' section of the application config file. See for more information. I note that a couple of the dependencies seem to have new major versions which are not referenced by your package. I think for now I'll abandon SpecsFor and just install the latest versions of Moq, Nunit and Should... Regards, Roger
Feb 17, 2016

Not sure how my first paragraph turned into all caps bold - but I hadn't meant to be SHOUTING. sorry...

Feb 17, 2016

Hi Roger, can you share the project you are trying to use with SpecsFor? It sounds like there's something wrong with your setup.

Feb 17, 2016

Sure Matt - what's the best way to share it with you?


Feb 17, 2016

If it doesn't contain anything proprietary, you could push it to Github.

Feb 17, 2016

Thanks Matt, I've done that.

Feb 18, 2016

I wasn't able to make heads or tails out of the pull request, but I created a stripped-down repo that might help:

As for the dependency issues, I think you are misunderstanding how that works. SpecsFor.Web.Helpers requires a minimum version of MVC 5.2.0, but it works fine with apps that use newer versions of MVC. All you have to do is update those NuGet packages in your spec project to match the versions in your corresponding web project.

I hope that helps!

marked this as solved
Markdown is allowed