Now that Visual Studio v15.5 is released, when can we expect Microsoft.Build 15.5 to be published to NuGet?
Yeah, I think I need this as well. Roslyn MSBuildWorkspace now fails with an error saying: Invalid static method invocation syntax: "[MSBuild]::IsRunningFromVisualStudio()". Method '[MSBuild]::IsRunningFromVisualStudio' not found. Static method invocation should be of the form: $([FullTypeName]::Method()), e.g. $([System.IO.Path]::Combine('a', 'b')).. :/
It's available on myget: https://dotnet.myget.org/feed/msbuild/package/nuget/Microsoft.Build/15.5.179
Maybe that helps?
Thanks @tverboon, that solved our problem anyway. (Although I don't like having to add another NuGet source, it sure beats waiting. :)
@alphaleonis i was hoping to not have to depend on nightlies... also there鈥檚 a newer build (.180).
We'll get that out in the next day or so, sorry for the delay!
And as an FYI .180 will be released with 15.5.1 whenever that goes out.
Done: https://www.nuget.org/packages/Microsoft.Build/
I put .180 on there as well, like I said it will go out with 15.5.1 when that releases. The only difference between 179 and 180 is e4c819961e3154152cd0c47681527784632aa55f.
Hi @alphaleonis
I'm also getting the same error. I would be really happy if you could share the practical steps of you solution. Thanks in advance.
@mmunchandersen Upgrade Microsoft.Build to v15.5 (or higher), and the problem goes away.
Microsoft added a new intrinsic function and immediately started using it in the SDK, so old versions of Microsoft.Build can no longer evaluate projects on a machine with Visual Studio v15.5 (or higher).
@yaakov-h thanks, however, how do one upgrade msbuild? I can't find any practical info on how to upgrade msbuild. Please share.
@mmunchandersen Using your NuGet client of choice - if you're using Visual Studio, go to Manage Package References for your project.
@AndyAyersMS I'm sorry to bother you, however, how do I get the latest msbuild version installed in my visual studio? If I run "Install-Package Microsoft.Build -Version 15.5.180" from the PM console I get this error:
Install-Package : The current environment doesn't have a solution open.
At line:1 char:1
@yaakov-h please forgive my ignorance, however, will I need to a) install (PM> Install-Package Microsoft.Build -Version 15.5.180) to each project in a solution or b) can I install msbuild 15.5.180 on my machine? If option b, how is this done?
@AndyGerlicher when can we expect VS 15.5.1? I've just upgraded VS to 15.5 and it broke VS and VS Code completely. How is it possible that MSBuild was not updated in the VS15.5 release?
@henkmollema Not quite sure what you mean. Our 15.5.179 package is what shipped with 15.5 VS. So MSBuild was definitely updated. I only mentioned the .180 because that's now the "latest" on NuGet (which will ship with the next minor VS update). It's shouldn't be relevant though, it's a super minor change (add empty target).
@AndyGerlicher is the error @alphaleonis mentioned related to that change? (I guess not)
Invalid static method invocation syntax: "[MSBuild]::IsRunningFromVisualStudio()". Method '[MSBuild]::IsRunningFromVisualStudio' not found. Static method invocation should be of the form: $([FullTypeName]::Method()), e.g. $([System.IO.Path]::Combine('a', 'b')).
I experience this too since upgrading to VS 15.
Could you point me in any direction to fix this? Thanks!
That looks like an older MSBuild trying to load the newer targets. I see that most when people GAC MSBuild for various reasons.
(run gacutil /l|findstr Microsoft.Build and see if you have anything Version=15.1.0.0 in there)
@AndyAyersMS search for "15" does not yield any results on my machine.
How do I get v15 into GAC?
PS C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6 Toolsx64> .\gacutil.exe /l|findstr Microsoft.Build
Microsoft.Build.Conversion.v3.5, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL
Microsoft.Build.Engine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL
Microsoft.Build.Engine, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL
Microsoft.Build.Engine.resources, Version=2.0.0.0, Culture=da, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL
Microsoft.Build.Framework, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL
Microsoft.Build.Framework, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL
Microsoft.Build.Tasks, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL
Microsoft.Build.Tasks.resources, Version=2.0.0.0, Culture=da, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL
Microsoft.Build.Tasks.v3.5, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL
Microsoft.Build.Utilities, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL
Microsoft.Build.Utilities.resources, Version=2.0.0.0, Culture=da, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL
Microsoft.Build.Utilities.v3.5, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL
Microsoft.Build, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL
Microsoft.Build, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL
Microsoft.Build.Conversion.Core, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL
Microsoft.Build.Conversion.Core.resources, Version=14.0.0.0, Culture=de, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL
Microsoft.Build.Conversion.Core.resources, Version=14.0.0.0, Culture=es, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL
Microsoft.Build.Conversion.Core.resources, Version=14.0.0.0, Culture=fr, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL
Microsoft.Build.Conversion.Core.resources, Version=14.0.0.0, Culture=it, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL
Microsoft.Build.Conversion.Core.resources, Version=14.0.0.0, Culture=ja, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL
Microsoft.Build.Conversion.Core.resources, Version=14.0.0.0, Culture=ko, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL
Microsoft.Build.Conversion.Core.resources, Version=14.0.0.0, Culture=ru, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL
Microsoft.Build.Conversion.Core.resources, Version=14.0.0.0, Culture=zh-HANS, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL
Microsoft.Build.Conversion.Core.resources, Version=14.0.0.0, Culture=zh-HANT, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL
Microsoft.Build.Conversion.v4.0, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL
Microsoft.Build.Conversion.v4.0.resources, Version=4.0.0.0, Culture=da, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL
Microsoft.Build.CPPTasks.Common, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL
Microsoft.Build.Engine, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL
Microsoft.Build.Engine, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL
Microsoft.Build.Engine.resources, Version=14.0.0.0, Culture=de, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL
Microsoft.Build.Engine.resources, Version=14.0.0.0, Culture=es, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL
Microsoft.Build.Engine.resources, Version=14.0.0.0, Culture=fr, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL
Microsoft.Build.Engine.resources, Version=14.0.0.0, Culture=it, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL
Microsoft.Build.Engine.resources, Version=14.0.0.0, Culture=ja, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL
Microsoft.Build.Engine.resources, Version=14.0.0.0, Culture=ko, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL
Microsoft.Build.Engine.resources, Version=14.0.0.0, Culture=ru, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL
Microsoft.Build.Engine.resources, Version=14.0.0.0, Culture=zh-HANS, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL
Microsoft.Build.Engine.resources, Version=14.0.0.0, Culture=zh-HANT, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL
Microsoft.Build.Engine.resources, Version=4.0.0.0, Culture=da, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL
Microsoft.Build.Framework, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL
Microsoft.Build.Framework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL
Microsoft.Build.resources, Version=14.0.0.0, Culture=de, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL
Microsoft.Build.resources, Version=14.0.0.0, Culture=es, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL
Microsoft.Build.resources, Version=14.0.0.0, Culture=fr, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL
Microsoft.Build.resources, Version=14.0.0.0, Culture=it, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL
Microsoft.Build.resources, Version=14.0.0.0, Culture=ja, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL
Microsoft.Build.resources, Version=14.0.0.0, Culture=ko, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL
Microsoft.Build.resources, Version=14.0.0.0, Culture=ru, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL
Microsoft.Build.resources, Version=14.0.0.0, Culture=zh-HANS, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL
Microsoft.Build.resources, Version=14.0.0.0, Culture=zh-HANT, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL
Microsoft.Build.resources, Version=4.0.0.0, Culture=da, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL
Microsoft.Build.Tasks.Core, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL
Microsoft.Build.Tasks.Core.resources, Version=14.0.0.0, Culture=de, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL
Microsoft.Build.Tasks.Core.resources, Version=14.0.0.0, Culture=es, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL
Microsoft.Build.Tasks.Core.resources, Version=14.0.0.0, Culture=fr, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL
Microsoft.Build.Tasks.Core.resources, Version=14.0.0.0, Culture=it, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL
Microsoft.Build.Tasks.Core.resources, Version=14.0.0.0, Culture=ja, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL
Microsoft.Build.Tasks.Core.resources, Version=14.0.0.0, Culture=ko, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL
Microsoft.Build.Tasks.Core.resources, Version=14.0.0.0, Culture=ru, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL
Microsoft.Build.Tasks.Core.resources, Version=14.0.0.0, Culture=zh-HANS, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL
Microsoft.Build.Tasks.Core.resources, Version=14.0.0.0, Culture=zh-HANT, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL
Microsoft.Build.Tasks.v12.0, Version=12.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL
Microsoft.Build.Tasks.v12.0.resources, Version=12.0.0.0, Culture=de, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL
Microsoft.Build.Tasks.v12.0.resources, Version=12.0.0.0, Culture=es, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL
Microsoft.Build.Tasks.v12.0.resources, Version=12.0.0.0, Culture=fr, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL
Microsoft.Build.Tasks.v12.0.resources, Version=12.0.0.0, Culture=it, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL
Microsoft.Build.Tasks.v12.0.resources, Version=12.0.0.0, Culture=ja, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL
Microsoft.Build.Tasks.v12.0.resources, Version=12.0.0.0, Culture=ko, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL
Microsoft.Build.Tasks.v12.0.resources, Version=12.0.0.0, Culture=ru, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL
Microsoft.Build.Tasks.v12.0.resources, Version=12.0.0.0, Culture=zh-Hans, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL
Microsoft.Build.Tasks.v12.0.resources, Version=12.0.0.0, Culture=zh-Hant, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL
Microsoft.Build.Tasks.v4.0, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL
Microsoft.Build.Tasks.v4.0.resources, Version=4.0.0.0, Culture=da, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL
Microsoft.Build.Utilities.Core, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL
Microsoft.Build.Utilities.Core.resources, Version=14.0.0.0, Culture=de, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL
Microsoft.Build.Utilities.Core.resources, Version=14.0.0.0, Culture=es, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL
Microsoft.Build.Utilities.Core.resources, Version=14.0.0.0, Culture=fr, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL
Microsoft.Build.Utilities.Core.resources, Version=14.0.0.0, Culture=it, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL
Microsoft.Build.Utilities.Core.resources, Version=14.0.0.0, Culture=ja, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL
Microsoft.Build.Utilities.Core.resources, Version=14.0.0.0, Culture=ko, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL
Microsoft.Build.Utilities.Core.resources, Version=14.0.0.0, Culture=ru, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL
Microsoft.Build.Utilities.Core.resources, Version=14.0.0.0, Culture=zh-HANS, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL
Microsoft.Build.Utilities.Core.resources, Version=14.0.0.0, Culture=zh-HANT, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL
Microsoft.Build.Utilities.v12.0, Version=12.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL
Microsoft.Build.Utilities.v12.0.resources, Version=12.0.0.0, Culture=de, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL
Microsoft.Build.Utilities.v12.0.resources, Version=12.0.0.0, Culture=es, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL
Microsoft.Build.Utilities.v12.0.resources, Version=12.0.0.0, Culture=fr, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL
Microsoft.Build.Utilities.v12.0.resources, Version=12.0.0.0, Culture=it, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL
Microsoft.Build.Utilities.v12.0.resources, Version=12.0.0.0, Culture=ja, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL
Microsoft.Build.Utilities.v12.0.resources, Version=12.0.0.0, Culture=ko, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL
Microsoft.Build.Utilities.v12.0.resources, Version=12.0.0.0, Culture=ru, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL
Microsoft.Build.Utilities.v12.0.resources, Version=12.0.0.0, Culture=zh-Hans, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL
Microsoft.Build.Utilities.v12.0.resources, Version=12.0.0.0, Culture=zh-Hant, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL
Microsoft.Build.Utilities.v4.0, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL
Microsoft.Build.Utilities.v4.0.resources, Version=4.0.0.0, Culture=da, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL
Sorry I should have been more clear. If you GAC a version of MSBuild from VS2017 (any version 15) it will always load that version of MSBuild. This breaks the side-by-side scenario and will cause issues on updates. I definitely do not recommend doing that, just noting that the times I've seen issues like this there are cases where, for whatever reason, people have added MSBuild assemblies to the GAC.
The issue here is that the targets from MSBuild 15.5 are being loaded by an engine version that is less than 15.5. This generally isn't supported, but also I'm not sure how this is happening. The target is under the VS install folder that ships with MSBuild. They're a single package, so they can't get out of date. It looks like multiple people are having this issue, so the question is what is the entry point (i.e. Visual Studio, msbuild.exe, or a custom app that build against our API) and how are the targets getting loaded?
I can't run gacutil right now as I'm not at the office. However, I've not deliberately GAC'ed my MSBuild version. I had VS 15.4 installed side-by-side with VS 15.5 preview. Today I've updated my VS 15.4 instance to VS 15.5 (via VS Installer tool) and removed my VS preview installation. After doing so I've been hitting above issue in both Visual Studio _and_ VS Code. I don't even know how they could be related.
Pinning the .NET Core SDK to the previous version (2.0.2 in my case) did not work. Neither does setting MSBuildSdksPath environment variable to the Sdks path in the 2.0.2 SDK.
Can you provide repro steps for Visual Studio?
I鈥檝e had this problem since around 15.5 preview 3, but only in third-party apps that use the MSBuild APIs, hence why I鈥檝e been waiting for the updated nuget package.
Speaking of 3rd party tools, I'm using Resharper and have the "Use ReSharper Build" option checked.
Un-checking the option, however, does not fix the problem.

Post to resharper-support.jetbrains.com:
https://resharper-support.jetbrains.com/hc/en-us/community/posts/115000747690-VS2017-15-5-upgrade-Could-Use-ReSharper-Build-cause-Invalid-static-method-invocation-syntax-MSBuild-IsRunningFromVisualStudio-
I haven't been using any preview versions.
The VS 15.5 update runs fine on another machine and causes no trouble for .NET Core projects. I'll run gacutil tomorrow and see if that contains any v15.x entries.
@mmunchandersen Have you tried disabling ReSharper completely or uninstalling it? Or any other extensions or plug-ins?
@henkmollema @yaakov-h I've had VS2017 Enterprise installed side-by-side with VS2017 pro for a long time. Been using pro all the time. Just tried and all projects load just fine in Enterprise (with ReSharper installed and doing the builds). It appears only my VS2017 pro 15.5 installation is broken.
@mmunchandersen @AndyGerlicher @yaakov-h I've repaired my VS installation using the installer, reboot, and it works again. VS Code also works again. No clue what went wrong before. 馃
@henkmollema the installer from https://www.visualstudio.com/downloads/ ?
Just type "visual studio installer" in start menu.
@henkmollema worked for me too :-) thanks
I was having a similar issue ([MSBuild]::IsRunningFromVisualStudio) using https://github.com/mrahhal/Migrator.EF6 after installing VS15.5, which installed the 2.1.x SDK. I ultimately added a global.json to the root of my repo and specified the 2.0.3 SDK and that took care of it. Hope this helps someone else.
I faced this issue after upgrading from VS Professional 15.4.1 to 15.5 and launching VS right after. I didn't make any change; just rebooted and re-launched VS, and things seemed to work fine. Can anyone else confirm this (i.e. just rebooting fixes the issue)?
It's almost March 2018 and it's still not possible (or at least not easy) to target .NET Framework when building with dotnet cli - needing to go through mono's msbuild is very unsatisfactory. Hope this gets some attention soon.
Most helpful comment
Yeah, I think I need this as well. Roslyn MSBuildWorkspace now fails with an error saying:
Invalid static method invocation syntax: "[MSBuild]::IsRunningFromVisualStudio()". Method '[MSBuild]::IsRunningFromVisualStudio' not found. Static method invocation should be of the form: $([FullTypeName]::Method()), e.g. $([System.IO.Path]::Combine('a', 'b')).. :/