Forum Xamarin.iOS
We are excited to announce that the Xamarin Forums are moving to the new Microsoft Q&A experience. Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

We encourage you to head over to Microsoft Q&A for .NET for posting new questions and get involved today.

How to share resources between projects?

TedRogersTedRogers USMember ✭✭✭✭

I am building a project that includes the main app, a today extension, a share extension, and a doc picker extension. I would like to share the same set of resources between those projects. What is the best way to do that?


  • SebastianKruseSebastianKruse USMember ✭✭✭

    One possible way is to implement the resources in a PCL project. Another way is to use links in you project and only in one project the "real" resource.

  • TedRogersTedRogers USMember ✭✭✭✭
    edited March 2017

    @SebastianKruse I am trying the link approach but Xamarin Studio is fighting me. I can't seem to figure out how to do that. For an Asset Catalog it doesn't seem to support that. I am trying to edit the csproj file directly but running into some project corruption issues doing that.

    Ok, figured out how to do that. The resources seem to get copied fine but I get this error. Indeed when I add the Assets.xcassets from the other project I end up with up with no Assets.xcassets on disk which makes sense but somehow it is not being handled properly. Perhaps I am adding the asset catalog incorrectly?

            Tool /Applications/ execution started with arguments: --errors --warnings --notices --output-format xml1 --compress-pngs --target-device iphone --target-device ipad --minimum-deployment-target 9.0 --platform iphonesimulator --compile /Users/trs2/Documents/TFS2/MobileApps/PDMApp/DocPickerExtension/obj/iPhoneSimulator/Debug/actool/bundle /Users/trs2/Documents/TFS2/MobileApps/PDMApp/DocPickerExtension/Resources/Assets.xcassets
    Resources/Assets.xcassets:  actoolerror : Failed to read file attributes for "/Users/trs2/Documents/TFS2/MobileApps/PDMApp/DocPickerExtension/Resources/Assets.xcassets"
  • TedRogersTedRogers USMember ✭✭✭✭

    I thought I had it by linking to the entire resources directory in the other project but that resulted in the same error above.

Sign In or Register to comment.