Skip to content

Instantly share code, notes, and snippets.

@Workshop2
Created May 22, 2015 07:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Workshop2/c9114fcd959bf4e1dfcf to your computer and use it in GitHub Desktop.
Save Workshop2/c9114fcd959bf4e1dfcf to your computer and use it in GitHub Desktop.
SpecsFor MVC with .NET 4.6
// SpecsFor MVC doesn't seem to pick up the correct MSBUILD to use
// when it tries to compile your web app to host in IIS express.
// If you add a reference in your Test project to "Microsoft.Build.Utilities.v12.0"
// you can then use the "ToolLocationHelper" to get the MSBUILD.exe for a VS version
string msBuild = ToolLocationHelper.GetPathToBuildToolsFile("msbuild.exe", "14.0"); // 14.0 hard coded for VS2015
var config = new SpecsForMvcConfig();
config.UseIISExpress()
.With(webProjectDirectory, solutionDirectory)
.ApplyWebConfigTransformForConfig("Acceptance")
.UseMSBuildExecutableAt(msBuild); // <-- This is the important part
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment