Bug 52596 - Unable to add reference to binding project
Summary: Unable to add reference to binding project
Status: RESOLVED ANSWERED
Alias: None
Product: iOS
Classification: Xamarin
Component: General ()
Version: XI 10.4 (C9)
Hardware: PC Windows
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2017-02-17 09:07 UTC by github
Modified: 2017-02-18 03:19 UTC (History)
2 users (show)

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


Attachments
Example projects failing to find each other in "Add References" (15.17 KB, application/zip)
2017-02-17 23:32 UTC, github
Details
Screencast illustrating adding a project reference for the projects in Comment 2 (6.43 MB, image/gif)
2017-02-18 02:10 UTC, Brendan Zagaeski (Xamarin Team, assistant)
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 ANSWERED

Description github 2017-02-17 09:07:05 UTC
Hi,

I'm trying to follow your instructions at https://developer.xamarin.com/guides/ios/advanced_topics/binding_objective-c/walkthrough/ to bind an Objective-C class into a Xamarin.iOS project. It seems to have gone OK except I can't add a reference to the binding project to the main project. When I try Project/Edit references the Projects tab is empty.

Has tried all sorts of locations for both projects to no avail. Do you have any suggestions?

Thanks,

John H.
Comment 1 Brendan Zagaeski (Xamarin Team, assistant) 2017-02-17 17:16:38 UTC
## Non-engineering team preliminary quick review

The broader Xamarin developer community might be the quickest place for troubleshooting help on this issue (since the "add project reference" feature is widely used).  Posting a question on Stack Overflow marked with the "xamarin" tag could be a good step.

Investigation in the bug tracker will usually require that an issue have some background info to hint that some standard troubleshooting steps have been taken to that suggest that the proper resolution for the behavior will require a code change in Xamarin.




## Some initial things to look at


The `<ProjectTypeGuids>` element in the bindings library .csproj file (when viewed in a text editor) should match:

> <ProjectTypeGuids>{8FFB629D-F513-41CE-95D2-7ECE97B6EEEC};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>


And the `<ProjectTypeGuids>` element in the Xamarin.iOS app project .csproj file should match:

> <ProjectTypeGuids>{FEACFBD2-3405-455C-9665-78FE426C6842};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>


If those items look correct in your project, one good next test would be to submit your zipped up solution (including both projects) on this bug report, or to share an example solution that shows the same problem either here (on the bug report) or with the broader Xamarin community on Stack Overflow or the Xamarin Forums.


Thanks in advance!
Comment 2 github 2017-02-17 23:32:55 UTC
Created attachment 19871 [details]
Example projects failing to find each other in "Add References"

Hi Brendan,

Thanks for the quick response. This process still eludes me. The Guids check out ok and I’ve prepared a quick pair of projects that demonstrate the problem (attached.) I should also say that I didn’t fill in the form correctly. I am using Xamarin 6.1.5 on MacOS 10.11.6 suing Xcode 8.2.1. I’ve google searched and as you say this problem does not seem to have been encountered before. It seems like a bug to me or perhaps something specific to my PC. Are you able to provide any more information about how Xamarin goes about finding related projects in the Add References panel that I can check? 

Also, I should report a minor thing. Objective-Sharpie generates a file “ApiDefinitions.cs" whereas the binding project is expecting a file “ApiDefinition.cs”.

Thanks

John
Comment 3 Brendan Zagaeski (Xamarin Team, assistant) 2017-02-18 02:10:22 UTC
Created attachment 19874 [details]
Screencast illustrating adding a project reference for the projects in Comment 2


Those projects work OK for me. Feel free to check the attached looping screencast .gif to compare with the steps you are using.

I will mark this issue as answered for now.  Please do be sure to take advantage of the  broader Xamarin communities on Stack Overflow and the Xamarin Forums [1] for guidance and tips tricks as you dig in to Xamarin further!

[1] https://forums.xamarin.com/
Comment 5 github 2017-02-18 03:19:47 UTC
Thanks Brendan, your gif showed it was user error. I didn’t know how to add a project to a project so I could then “Edit References”. Your gif was very informative.

I’m up and running now.

Cheers!