Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
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
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 for Bug 17026 on
GitHub or Developer Community if you have new
information to add and do not yet see a matching new report.
If the latest results still closely match this report, you can use the
In special cases on GitHub you might also want the comments:
GitHub Markdown with public comments
I created few samples that demonstrate the following cases regarding PCL.
Issue 1: PCL cannot include Regular Library. But this works fine in Xamarin studio but fails in Visual Studio.
* From the attached code "PCL-Inclusion of RegLib.zip", I had 2 libs, PCLLib (PCL Library) and RegLib (Normal regular library).
* Here PCLLib invokes one of the method of RegLib and hence includes RegLib.
* This works fine in Xamarin but FAILS in Visual Studio.
* You can run the solution to validate this statement.
* Instructions to run the Application:
* Don’t pull the folders/projects out of the Unzipped folder.
* You can test on either of the platforms iOS or Android. Lets say for iOS.
* Compile RegLib first and then PCLLib and then iOSLib.
* Now compile iOSNativeApp and run.
* You may see the output on the console, saying that the strings are coming from RegLib and PCLLib too.
* Follow the same for Droid if you want to.
[test project PCL-Inclusion of RegLib.zip attached]
I'm not nearly an expert on PCL, but it seems to me that the described scenario is indeed an invalid one and that VS behavior is correct and that the regular lib working in an XS-compiled application is by pure chance.
Martin, can you take a look, please? If the fix is simple we might want to consider including it in 1.10 (after approval from QA of course) if not, we'll put it in 1.12. Thanks!
Jon, I changed the product version in the bug description to 1.10 (from 1.8) since that's what your version report contains.
I agree, in this instance I think XS is incorrect and Visual Studio is behaving correctly. You should NOT be able to reference a normal library project from a PCL. You can reference other PCL projects/libraries/assemblies but that is it.
This will probably apply to https://bugzilla.xamarin.com/show_bug.cgi?id=17027 as well.
Haven't looked at the test case yet, but from your description, I agree that this should be invalid. Detecting "invalid" library reference is something that has not received very much testing, so I'm not too surprised to find bugs ;-)
I'm moving this to XS based on the last few comments.
XS does NOT let you reference a normal library project from a PCL project. However, this reference was added as a dll reference, not a project reference, and neither XS or VS validates these. You are correct that this is invalid, but it's something that should be enforced by the compiler, not the IDE.
How does it fail in VS?
Hmm, I don't see how this could possibly work with Mono / XS. The normal library should contain a reference to the "normal" .NETFramework corlib, so the compiler should really generate an error.
You should not be able to compile the PCLLib.csproj, attaching msbuild output.
Created attachment 5820 [details]
So it seems like MSBuild checks this in the "ResolveAssemblyReferences" target. I'll have a look at this.
As a first step, I'll write some test case for this msbuild task, then check what happens if you attempt to invoke the compiler directly.