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 on
Developer Community 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.
[Cycle 7] Xamarin.Android targets lead to ReSharper error in VS 2013: "Module 'Java.Interop...' should be referenced"
The dependencies on `Java.Interop` and `System.Runtime` in the Cycle 7 version of Xamarin.Android are interesting / special:
> The current Xamarin.Android targets files auto-add Java.Interop and
> System.Runtime to the @(Reference) collection
In VS 2013 (but not VS 2015), this trips up ReSharper's analysis of the project dependencies, leading to an ignorable error message.
## Regression status: "regression" in Cycle 7
Although this is technically a change in behavior compared to Xamarin Cycle 6, it is also only a regression in the very specific context of ReSharper. It's possible that there's an upstream bug or limitation in ReSharper itself where it doesn't properly interpret the slightly more advanced technique used by the new Xamarin.Android targets.
Since the issue does not seem to affect VS 2015 and higher, it might be acceptable to resolve this as a known limitation of older ReSharper in older VS versions, with a workaround.
## Possible workarounds
(a) Disable ReSharper.
(b) Explicitly add references to both `Java.Interop` and `System.Runtime` in the Android project.
## Steps to replicate
1. Enable ReSharper in Visual Studio 2013.
2. Create a new "Visual C# > Android > Blank App (Android)" project.
3. Wait for ReSharper to finish analyzing the project.
4. Open "ReSharper > Windows > Solution Errors".
ReSharper's "Solution Errors" window shows several errors about a missing reference to `Java.Interop`:
> TestApp\MainActivity.cs:12 Module 'Java.Interop, Version=0.1.0.0, Culture=neutral, PublicKeyToken=84e04ff9cfb79065' should be referenced
This error does _not_ affect the build process since the build process successfully auto-adds the `Java.Interop` and `System.Runtime` dependencies.
*** Bug 40476 has been marked as a duplicate of this bug. ***
This also affects VS2015 with older versions of ReSharper installed. Currently running 2015 with ReSharper 9.1.3 and having the same issue.
I have VS2015 and Resharper 2016.1.2 (the latest one) and after upgrading Xamarin to the Cycle 7 I have the same problem.
After discussing with ReSharper we decided to close this as External. Supporting twit (which doesn't really say much): https://twitter.com/kzu/status/760565188319993856