Bug 17857 - Intellisense does not work for types referenced from Android Java Bindings Library projects
Summary: Intellisense does not work for types referenced from Android Java Bindings Li...
Alias: None
Product: Visual Studio Extensions
Classification: Xamarin
Component: Android ()
Version: 4.5.0 (15.2)
Hardware: PC Windows
: --- normal
Target Milestone: Future Cycle
Assignee: vsx
Depends on:
Reported: 2014-02-18 16:13 UTC by Brendan Zagaeski (Xamarin Team, assistant)
Modified: 2017-07-24 10:35 UTC (History)
12 users (show)

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

Test case (87.89 KB, application/zip)
2014-02-18 16:13 UTC, Brendan Zagaeski (Xamarin Team, assistant)
Test case (70.49 KB, application/zip)
2014-02-24 12:06 UTC, Brendan Zagaeski (Xamarin Team, assistant)

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 for Bug 17857 on 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 original description:

  • Export the original title and description: Developer Community HTML
  • Copy the title and description into the new report. Adjust them to be up-to-date if needed.
  • Add your new information.
Related Links:

Description Brendan Zagaeski (Xamarin Team, assistant) 2014-02-18 16:13:57 UTC
Created attachment 6085 [details]
Test case

## Steps to reproduce

1. Open attached test case in VS 2013.

2. Build the AndroidBindingIntellisense project.

3. Open the `MainActivity.cs` from the AndroidBindingIntellisense project in the editor.

4. Start typing the following line beneath the existing two "var x = ..." lines:
> var z = new BindingLib.MyJavaView(this);

## Result

Visual Studio does not offer Intellisense autocomplete suggestions for `BindingLib` or `MyJavaView`. Additionally the existing `BindingLib` namespace in the "var x = ..." line causes the following error to appear in the Error List window:

The type or namespace name 'BindingLib' could not be found (are you missing a using directive or an assembly reference?)

## Workaround

In the AndroidBindingIntellisense project, remove the reference to the BindingLib _project_, and instead reference the compiled BindingLib.dll.

## Version information
Tested with:
Xamarin.Android 4.10.02014
Comment 1 Sadik Ali 2014-02-24 03:35:06 UTC
I tried to open attached project in VS 2013 but getting "Unsupported " error message and attached project not opened.

Refer screen shot: http://screencast.com/t/YAuKcIJkvdq

Let me know if I need any setting to open this project.
Comment 2 Brendan Zagaeski (Xamarin Team, assistant) 2014-02-24 12:06:59 UTC
Created attachment 6128 [details]
Test case

Hmm. Somehow I left two copies of the solution in the .zip.

Here's an updated version with just 1 solution. Hopefully this will work. That said, I was able to open both solutions from the old zip with Visual Studio, so I'm not 100% sure where the "Unsupported" error is coming from.

I also noticed that the binding project template for Visual Studio has a different ProjectTypeGuids element [1, 2], so I switched that to match the Visual Studio value. Maybe that will help.

[1] From Xamarin Studio 4.2.3 (build 54), Xamarin.Android 4.12.0-22:

[2] From Visual Studio 2013, Xamarin.Android 4.12.00022:
Comment 3 Sadik Ali 2014-02-25 03:25:41 UTC
I have checked this issue on below environments:

Window 7
VS 2013
X iOS: 1.10.39

After build application I noticed that when I typed "BindingLib" getting error for reference of this library.
Refer screen cast: http://screencast.com/t/FEFGCCk2
Comment 4 PJ 2015-03-19 16:14:47 UTC
3.10 was scratched and the only milestone tracked for what was the 3.10 release is VS2015-CTP6. Moving open 3.10 bugs to 3.11 for review.
Comment 5 Jose Gallardo 2015-03-19 17:15:48 UTC
Updating target milestone to Cycle 6
Comment 6 Mohit Kheterpal 2015-08-03 09:28:30 UTC
I have checked this issue with latest stable build of XVS i.e. 3.11.666 and observed that this issue still exist i.e. 

>Visual Studio does not offer Intellisense autocomplete suggestions for `BindingLib` or >`MyJavaView`.
Comment 7 Jon Douglas [MSFT] 2016-11-30 20:18:37 UTC
Some further observations:

It seems that there is a clear distinction of the `Debug` configuration vs. the `Release` configuration when using Visual Studio's `Object Browser` from a project that is referencing a binding project.

Example: http://screencast.com/t/2Z9D6KhrYAlc

Thus with the current workaround, one could also simply set the configuration to `Release` to get proper intellisense to a referenced binding project.

I can confirm this enabled intellisense correctly:


As for another confirmation to https://bugzilla.xamarin.com/show_bug.cgi?id=17857#c0 you could alternatively reference the already built .dll instead of a project reference.

So overall it seems that there is a disconnect of what classes are brought into the project in `Debug` and `Release` mode and there are now two workarounds provided.