I have a problem with SpecsFor.Mvc
I'm trying run host server:
public static SpecsForIntegrationHost _host;
public void SetupTestRun()
{
string msBuild = ToolLocationHelper.GetPathToBuildToolsFile("msbuild.exe", "16.0");
var config = new SpecsForMvcConfig();
config.UseIISExpress()
.With(Project.Named("WeatherApp.FrontEnd"))
.UseMSBuildExecutableAt(msBuild);
config.BuildRoutesUsing(r => RouteConfig.RegisterRoutes(r));
config.UseBrowser(BrowserDriver.InternetExplorer);
_host = new SpecsForIntegrationHost(config);
_host.Start();
}
But I'm getting this error:
System.IO.FileLoadException: 'Could not load file or assembly 'System.Web.Mvc, Version=5.2.4.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' r one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)'
How can I resolve it? Or is there another similar framework for integration tests?
It sounds like your spec project is referencing one version of ASP.NET MVC, and your actual web app is referencing another. If you're using Visual Studio, you can right click on the solution and choose "Manage NuGet Packages," then go to the "Consolidate" tab. While you're at it, it wouldn't hurt to make sure both projects are running the latest versions of ASP.NET MVC to begin with, and that you have the appropriate binding redirects on both projects to ensure everything is forwarded to the correct version of MVC.
I hope that helps!
User contributions licensed under CC BY-SA 3.0