Bug 17835 - Maybe intentional: C# Library Projects no longer "see" XamMac assembly in "Edit References"
Summary: Maybe intentional: C# Library Projects no longer "see" XamMac assembly in "Ed...
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: Mac Add-in ()
Version: 4.2.3
Hardware: PC Mac OS
: Normal normal
Target Milestone: master
Assignee: Jeffrey Stedfast
Depends on:
Reported: 2014-02-17 18:58 UTC by Brendan Zagaeski (Xamarin Team, assistant)
Modified: 2014-08-13 12:18 UTC (History)
4 users (show)

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

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:

Description Brendan Zagaeski (Xamarin Team, assistant) 2014-02-17 18:58:13 UTC
Up through Xamarin Studio 4.2.2, I think a common way to create library projects for Xamarin.Mac was to create C# library projects that referenced XamMac.dll.

Xamarin Studio 4.2.3 includes a new "Xamarin.Mac Library Project" template. This template has the same ProjectTypeGuids as as a normal Xamarin.Mac application project, and it sees XamMac assembly in the "Edit References" window without a problem.

In contrast, now the plain C# "Library" project template no longer sees the XamMac assembly in the "Edit References" window.

If this is an intentional change, perhaps a corresponding note could be added to the release notes [1].

> [1] http://docs.xamarin.com/releases/studio/xamarin.studio_4.2/xamarin.studio_4.2/#3

## Possible workarounds

1. Use the "Xamarin.Mac Library Project" type instead of the C# "Library" project type. Note that at the moment, an additional small workaround is needed to fix up this new project type (bug #17834).

2. Add the XamMac.dll file to a plain C# Library project using the ".Net Assembly" tab of the references editor, or edit the .csproj in a text editor, and add the XamMac reference, including a HintPath:

> <Reference Include="XamMac">
> 	<HintPath>\Library\Frameworks\Xamarin.Mac.framework\Versions\1.6.27\lib\mono\XamMac.dll</HintPath>
> </Reference>

See also:
Comment 1 Sadik Ali 2014-02-27 05:17:26 UTC
I have checked this issue on below environments:

All Mac
XS 4.2.3 (Build 59)
X. Mac 1.6.27

I followed below steps:

1. Created "Xamarin.Mac Library Project" and noticed that "XamMac" assembly added automatically in project and also present in "Edit Reference" window.
2. Created normal class library and noticed that "XamMac" not present in "Edit Reference" window.
Refer screen cast: http://screencast.com/t/Sdz8Iga10dsY
Comment 2 Jeffrey Stedfast 2014-06-12 14:52:27 UTC
This is intentional - use the Xamarin.Mac Library project type.
Comment 3 Mikkel Kamstrup Erlandsen 2014-08-13 12:18:38 UTC
I spend quite some time being confused until I Googled up this bug report. I think it would be nice with some kind of resolution to this. More and more projects start to rely on XamMac only, no longer working with MonoMac (MonoGame, CocosSharp, presumably more to follow). This causes a host of projects out there to go into an "unfixable state" without setting up an entirely new solution with the XamMac template... I expect a lot of people will be searching the Edit References dialog for XamMac.