-
-
Notifications
You must be signed in to change notification settings - Fork 173
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GetBuildVersion task fails with System.MissingMethodException
when building with Mono MSBuild on macOS
#306
Comments
If you use package version 2.3.38 then the issue does not reproduce, meaning that it is something that has changed since then to 2.3.125. |
We are consistently getting this on our project ReactiveUI, downgrading to 2.3.38 is a workaround |
I'm getting the same issue here (Building with Visual Studio for Mac). The method it's complaining about looks to be a recent addition to Newtonsoft.Json, so possibly down to the package version being updated in c147f37#diff-574082642ffdd7d9cbcbe853e627a843 ? (sounds like it's trying to use the old version of the assembly that is missing the new method?) |
I'm hitting the same issue. |
@radical ^ I think we need to update the
|
to work around dotnet/Nerdbank.GitVersioning#306
If the newtonsoft.json assembly version changed (from 11 to 12) then why would mono's msbuild's version of newtonsoft.json matter? If it shipped 11 or older, and I want 12, I should still get 12. Unless either mono doesn't follow the same binding rules that the CLR does, or mono's msbuild.exe.config redirects 12 to 11, which would be bad. |
I'm noticing a bunch of bugs with the mono msbuild with it having one version which prevents the newer one being used. Eg NuGet/Home#7956 (comment) for example required me to downgrade my nuget package version on a tool recently. |
Yes, Mono's binding rules have historically been simpler. IIRC unless the relatively recently added strict mode is enabled, then only one dll with a particular name can be loaded regardless of version. The MSBuild.dll.config doesn't appear to have any binding redirects either. |
That copy of |
@mhutch How do you enable the strict mode? |
What version of newtonsoft.json does mono msbuild ship? I don't mind downgrading for now to unblock folks. |
Is it referencing the newer newtonsoft.json that causes issues, or just using the new NamingStrategy property? (the change in 845badf) ? (the version used by Mono apparently predating that property being there) |
Apparently mono has no problem with us referencing a higher assembly version. But I refuse to just remove our use of the property while continuing to reference the newer version, as that is a very fragile situation. |
The FileVersion appears to be 9.0.1.19813 |
@radical do we know why the NuGet tasks use such an old version? |
Would someone who can repro the problem please help verify #362 is effective by downloading the nupkg from the PR build artifacts, install it, and see if it works? |
that build seems to work for me in Visual Studio for Mac (8.2) |
Works in our CI build environment that was failing before. |
I had this issue with a Xamarin project build. Thinking it might be the fix I needed, too. |
Great. I'll merge and push to nuget.org then. |
This is fixed in v2.3.183. |
Version information
Repro Steps
version.json
file (see below)msbuild /t:restore && msbuild
from a Terminal outside VSMac)(Note: I also tried installing the
nbgv
tool and doingnbgv install
.. the same error/behaviour surfaces. I don't think this is a solution/project configuration issue.)Expected behaviour
The build is successful 😄
Actual behaviour
Build error 😢
Curiously, when using the .NET Core CLI toolchain then the build succeeds (
dotnet build
rather thanmsbuild
, the latter being what VSMac uses).Build output
version.json
Project file
Solution file
The text was updated successfully, but these errors were encountered: