web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Supply chain | Supply Chain Management, Commerce
Suggested Answer

How do I fix MSBuild error MSB4186

(1) ShareShare
ReportReport
Posted on by 1,461
I'm trying to run the MSBuild on the developer command  prompt for VS2017 to build a retailSDK deployable package.
I'm on v10.0.35. I was able to build it successfully last week. I have no idea why I get the below error now. I must have changed something in my cloud-hosted Dev environment but I don't know what.
 
The command that I run on VS2017 developer command prompt as administrator after cd'ed to <full path>, is: msbuild /p:CheckVSDependencies=False -t:rebuild
*********************
/<full path>//dirs.proj/ (rebuild target) (1) ->
(RestorePackages target) ->
  C://Users//<Admin>//AppData//Local//Temp//NuGetScratch//bc0d2drn.qqz.nugetrestore.targets(65,17): error MSB4186: Inv
alid static method invocation syntax: /[MSBuild]::VersionGreaterThanOrEquals($([MSBuild]::ValueOrDefault('$(NETCoreSdkV
ersion)', '0.0')), '8.0')/. Method '[MSBuild]::VersionGreaterThanOrEquals' not found. Static method invocation should b
e of the form: $([FullTypeName]::Method()), e.g. $([System.IO.Path]::Combine(`a`, `b`)).  [C://Users//<Admin>//App
Data//Local//Temp//NuGetScratch//0ggytap4.zcn.nugetinputs.targets] [<full path>//dirs.proj]
  <full path>//dirs.proj(44,9): error MSB3073: The command /powershell -NoProfile -NonInteractive
 .//BuildTools/ugetRestore.ps1/ exited with code 1.
 
<fuill path>//dirs.proj(44,9): error MSB3073: The command /powershell -NoProfile -NonInteractive .
//BuildTools/ugetRestore.ps1/ exited with code 1.
Done Building Project /<full path>//dirs.proj/ (rebuild target(s)) -- FAILED.
********************
 
I ran a repair on Visual Studio 2017 in the hopes it will fix whatever is wrong but nothing works.
 
Any help to get MSBUILD working  again is much appreciated.
 
 
I have the same question (0)
  • Suggested answer
    Retha Profile Picture
    1,461 on at
    This is a bug and Microsoft has already a hotfix ticket for it: Bug # 837779.
    As a workaround Microsoft told me to for now download an earlier version of the nuget application.
    So for those who ran into the same issue, go to nuget.org and download version 6.6.1 of the nuget executable and save it to the References folder in your RetailSDK, overwriting the one that came with v10.0.35 RetailSDK.
    MSBuild will build successfully with the earlier version of the nuget executable.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Supply chain | Supply Chain Management, Commerce

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 88 Super User 2026 Season 2

#2
Laurens vd Tang Profile Picture

Laurens vd Tang 69 Super User 2026 Season 2

#3
Sagar Suman Profile Picture

Sagar Suman 38 Super User 2026 Season 2

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans