Bug 59270 - iOS class library with Newtonsoft.JSON yields "found conflicts" warning. No way to get rid of warning
Summary: iOS class library with Newtonsoft.JSON yields "found conflicts" warning. No w...
Status: RESOLVED DUPLICATE of bug 57842
Alias: None
Product: iOS
Classification: Xamarin
Component: MSBuild ()
Version: XI 10.14 (d15-4)
Hardware: Macintosh Mac OS
: --- major
Target Milestone: Untriaged
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2017-09-06 19:32 UTC by Nate Cook
Modified: 2017-09-21 19:14 UTC (History)
3 users (show)

Tags: 15.3I
Is this bug a regression?: ---
Last known good build:


Attachments
sample repro project (5.81 KB, application/zip)
2017-09-06 19:32 UTC, Nate Cook
Details


Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED DUPLICATE of bug 57842

Description Nate Cook 2017-09-06 19:32:01 UTC
# Steps to reproduce
Create an iOS Class Library
Add a reference to Newtonsoft.JSON
Build

# Expected behavior
No warnings, or if there is a warning you can get rid of it with AutoGenerateBindingRedirects, or by adding an app.config file to the project.

# Actual behavior
/Library/Frameworks/Mono.framework/Versions/5.2.0/lib/mono/msbuild/15.0/bin/Microsoft.Common.CurrentVersion.targets(5,5): Warning MSB3277: Found conflicts between different versions of the same dependent assembly that could not be resolved.  These reference conflicts are listed in the build log when log verbosity is set to detailed. (MSB3277)
- There was a conflict between "Microsoft.CSharp, Version=2.0.5.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" and "Microsoft.CSharp, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a".       
- There was a conflict between "mscorlib, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e" and "mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089".
- There was a conflict between "System, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e" and "System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089".
- There was a conflict between "System.Core, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e" and "System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089".

# Supplemental info (logs, images, videos)
Sample project will be attached

# Test environment (full version information)
=== Visual Studio Professional 2017 for Mac ===

Version 7.1 (build 1297)
Installation UUID: 3234d07d-f7a0-4180-b21d-d2c24ed872f6
Runtime:
	Mono 5.2.0.215 (d15-3/da80840) (64-bit)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 502000215

=== NuGet ===

Version: 4.3.0.2418

=== .NET Core ===

Runtime: /usr/local/share/dotnet/dotnet
Runtime Versions:
	2.0.0
	1.0.3
SDK: /usr/local/share/dotnet/sdk/2.0.0/Sdks
SDK Versions:
	2.0.0
	1.0.0-preview2-003156
MSBuild SDKs: /Library/Frameworks/Mono.framework/Versions/5.2.0/lib/mono/msbuild/15.0/bin/Sdks

=== Xamarin.Profiler ===

Version: 1.5.5
Location: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler

=== Apple Developer Tools ===

Xcode 8.3.3 (12175.1)
Build 8E3004b

=== Xamarin.iOS ===

Version: 10.12.0.20 (Visual Studio Professional)
Hash: 80b8487d
Branch: d15-3
Build date: 2017-08-18 16:07:26-0400

=== Xamarin.Android ===

Version: 7.4.0.21 (Visual Studio Professional)
Android SDK: /Users/ncook/Library/Developer/Xamarin/android-sdk-macosx
	Supported Android versions:
		4.1 (API level 16)
		4.4 (API level 19)
		5.0 (API level 21)
		5.1 (API level 22)
		6.0 (API level 23)
		7.0 (API level 24)
		7.1 (API level 25)

SDK Tools Version: 25.2.5
SDK Platform Tools Version: 26
SDK Build Tools Version: 25.0.3

Java SDK: /usr
java version "1.8.0_102"
Java(TM) SE Runtime Environment (build 1.8.0_102-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.102-b14, mixed mode)

Android Designer EPL code available here:
https://github.com/xamarin/AndroidDesigner.EPL

=== Xamarin.Mac ===

Version: 3.6.0.19 (Visual Studio Professional)

=== Xamarin Inspector ===

Version: 1.2.2
Hash: b71b035
Branch: d15-1
Build date: Fri, 21 Apr 2017 17:57:12 GMT

=== Build Information ===

Release ID: 701001297
Git revision: 9c5299666538b2f8baf501418a5c064d784d64da
Build date: 2017-08-07 11:29:35-04
Xamarin addins: 3bb0c32a14f1b7e368bf5ac53a84c3581c019391
Build lane: monodevelop-lion-d15-3

=== Operating System ===

Mac OS X 10.12.6
Darwin 16.7.0 Darwin Kernel Version 16.7.0
    Thu Jun 15 17:36:27 PDT 2017
    root:xnu-3789.70.16~2/RELEASE_X86_64 x86_64

=== Enabled user installed addins ===

AddinMaker 1.3.7
Manifest.addin 0.0.0.0
Comment 1 Nate Cook 2017-09-06 19:32:38 UTC
Created attachment 24608 [details]
sample repro project
Comment 2 Nate Cook 2017-09-06 19:37:21 UTC
I tried adding an app.config. I also tried setting AutoGenerateBindingRedirects to true. But nothing seems to help.
Comment 3 Nate Cook 2017-09-06 20:04:09 UTC
One more update: I tried setting GenerateBindingRedirectsOutputType to true as well. In the detailed build log I see

Target GenerateBindingRedirects:
  Building target "GenerateBindingRedirects" completely.
  Output file "obj/Debug/IosClassLibrary.csproj.IosClassLibrary.dll.config" does not exist.
  Using "GenerateBindingRedirects" task from assembly "Microsoft.Build.Tasks.Core, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a".
  Task "GenerateBindingRedirects"
    No suggested binding redirects from ResolveAssemblyReferences.
  Done executing task "GenerateBindingRedirects".
Target "GenerateBindingRedirectsUpdateAppConfig" skipped, due to false condition; ('$(AutoGenerateBindingRedirects)' == 'true' and '$(GenerateBindingRedirectsOutputType)' == 'true' and Exists('$(_GenerateBindingRedirectsIntermediateAppConfig)')) was evaluated as ('true' == 'true' and 'true' == 'true' and Exists('obj/Debug/IosClassLibrary.csproj.IosClassLibrary.dll.config')).

The App.config does not get copied to the obj directory. (Not sure why.) If I copy it there manually just to hack it and see what happens I get:

Target GenerateBindingRedirects:
  Building target "GenerateBindingRedirects" completely.
  Input file "obj/Debug/IosClassLibrary.csprojResolveAssemblyReference.cache" does not exist.
  Task "GenerateBindingRedirects"
    No suggested binding redirects from ResolveAssemblyReferences.
  Done executing task "GenerateBindingRedirects".
Target GenerateBindingRedirectsUpdateAppConfig:

Notice how GenerateBindingRedirectsUpdateAppConfig is empty. Nothing is printed.

I have switched to the alpha branch and I observe the same behavior there. I will update the version accordingly.
Comment 4 Manuel de la Peña [MSFT] 2017-09-08 14:45:46 UTC
Changing to MSBuild but I'll double check if I can confirm the issue.
Comment 5 Jeffrey Stedfast 2017-09-18 19:05:24 UTC

*** This bug has been marked as a duplicate of bug 57842 ***
Comment 6 Nate Cook 2017-09-21 19:14:18 UTC
Are you sure this is a duplicate of 57842? I'm able to reproduce these warnings also with iOS and Android projects. I logged it separately just in case: 59665