Bug 14854 - Library project non default resources files are not copied into bundle
Summary: Library project non default resources files are not copied into bundle
Status: RESOLVED FEATURE
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: Mac Add-in ()
Version: Trunk
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: ---
Assignee: Jeffrey Stedfast
URL:
Depends on:
Blocks:
 
Reported: 2013-09-19 10:03 UTC by David Lambert
Modified: 2013-12-06 11:11 UTC (History)
4 users (show)

Tags:
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:
Status:
RESOLVED FEATURE

Description David Lambert 2013-09-19 10:03:33 UTC

    
Comment 1 Aaron Bockover [MSFT] 2013-09-26 13:02:45 UTC
I'm not sure what you mean here. Can you provide a test case / sample project / better directions on how to reproduce the issue?

Resources added to the blue "Resources" folder in Xamarin.Mac projects should have their build action automatically set to "Bundle Resource". If you wish to use a different directory, you will need to manually set the build action as such.
Comment 2 Aaron Bockover [MSFT] 2013-12-06 11:11:07 UTC
Currently library projects must be Xamarin.Mac projects. Xamarin Studio does not support copying resources into the resulting .app from non Xamarin.Mac projects (e.g. vanilla C# library projects). The build action for resources must be "Bundle Resource" and not "Content" within aXamarin.Mac project.

Creating a new Xamarin.Mac project and then changing the project's compile target to "Library" should work for now; Xamarin Studio 4.2.3, when released, will introduce a new project template for Xamarin.Mac libraries, which essentially is a template that does this for you for new projects.

If you have existing non-Xamarin.Mac library projects and wish to convert them, you can also prepend the Xamarin.Mac flavor guid to the existing .csproj file. Before:

<ProjectTypeGuids>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>

After:

<ProjectTypeGuids>{42C0BBD9-55CE-4FC1-8D90-A7348ABAFB23};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>

Alternatively, if you cannot change the ProjectTypeGuids in your vanilla C# library projects (e.g. they are used for other platforms), you can define post-build rules that perform the copying of resources into the .app.

We may in the future support treating "Content" build actions on non-Xamarin.Mac projects as "Bundle Resource", but it is not currently on the radar. Vanilla library projects shouldn't have platform-specific assumptions (such as where to copy "Content" files). For this reason it's probably best to define these copy actions as post-build rules on the platform project (e.g. the main Xamarin.Mac executable project).

Closing due to lack of response to the NEEDINFO and the explanation above.