Bug 44363 - Build errors using Lists and Tasks of a referenced PCL
Summary: Build errors using Lists and Tasks of a referenced PCL
Status: RESOLVED DUPLICATE of bug 44535
Alias: None
Product: Android
Classification: Xamarin
Component: MSBuild ()
Version: unspecified
Hardware: PC Windows
: --- blocker
Target Milestone: 7.0.1 (C8SR1)
Assignee: dean.ellis
URL:
Depends on:
Blocks:
 
Reported: 2016-09-15 13:03 UTC by s.figliola
Modified: 2016-09-23 20:06 UTC (History)
8 users (show)

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


Attachments
Test solution (33.90 KB, application/x-zip-compressed)
2016-09-22 12:29 UTC, s.figliola
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 44535

Description s.figliola 2016-09-15 13:03:38 UTC
# Steps to reproduce
Create a Portable Class Library. Create a class with a System.Collection.Generic.List<string> property. Add a reference to this PCL into a Xamarin.Android project. Create an instance of the class and use the List<> property previuously created.

# Expected behavior


# Actual behavior
Build errors:
Error	1	The type 'System.Collections.Generic.List`1<T0>' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Collections, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.	d:\documents\visual studio 2013\Projects\TestApp\TestApp\MainActivity.cs	18	13	TestApp
Error	2	Cannot implicitly convert type 'System.Collections.Generic.List<string>' to 'System.Collections.Generic.List`1<string>'	d:\documents\visual studio 2013\Projects\TestApp\TestApp\MainActivity.cs	18	23	TestApp


# Supplemental info (logs, images, videos)


# Test environment (full version information)
Visual Studio 2013 Professional
Windows 10 Anniversary Update
Tested building against Android 5.0 and 6.0, same errors in both versions.
Comment 1 Atsushi Eno 2016-09-16 05:32:12 UTC
Could you tell us which PCL Profile you chose? That has to be compatible with Xamarin.Android.
Comment 2 s.figliola 2016-09-16 08:01:05 UTC
I am targeting:
.NET Framework 4.5
Windows 8
Windows Phone 8.1
Windows Phone Silverlight 8
Xamarin.Android
Xamarin.iOS
Xamarin.iOS (Classic)
Comment 3 dean.ellis 2016-09-22 10:35:33 UTC
Hi 

I have tried to replicate this issue on the latest Stable release of Xamarin.Android on Windows. I have been unable to do so. 

Any chance you can attach the problem project?
Comment 4 s.figliola 2016-09-22 12:29:07 UTC
Created attachment 17674 [details]
Test solution

Very simple sample.
Comment 5 dean.ellis 2016-09-22 14:47:29 UTC
I just realised why it worked for me, I am using VS2015 not VS 2013. 
Asking the VS team to see if they can reproduce the issue.
Comment 6 Brendan Zagaeski (Xamarin Team, assistant) 2016-09-23 20:06:20 UTC
According to the following testing, this is a duplicate of Bug 44535.




## Verification for the test case from Comment 4

BAD:  Cycle 8 without the `<DependsOnSystemRuntime>` line in the `.props file`

GOOD: Cycle 8 _with_ the `<DependsOnSystemRuntime>` line in the `.props file`




Brendan
Xamarin Customer Support

*** This bug has been marked as a duplicate of bug 44535 ***