How to find latest version of MsBuild in powershell

Build scripts for .net are always a bit painful, and Microsoft has not made it easy over the years as every release they change the paths. For 2017 it is even worse and it depends on the edition so they want you to use vswhere.exe to locate the installed version(s) of msbuild. I find the following bit of Powershell to be far more portable and reliable. Function Find-MsBuild([int] $MaxVersion = 2017) { $agentPath = "$Env:programfiles (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15....

September 19, 2017 · 2 min · 228 words · Alastair Crabtree

Cannot open VS 2015 Web project in VS 2017

Brand new installs of Visual Studio 2017 do not seem to be able to open some older web projects created in Visual Studio 2015 or before. To fix you need to add one line to your csproj file. The problem When you open the solution in VS 2017 the project will not be loaded. If you try and right click and reload the project check the output window to see the following error:...

April 5, 2017 · 2 min · 295 words · Alastair Crabtree