Hi,
I'm trying to build a mono mac project which has language resx files & rtf files in the project.
And a normal debug/release builds gives language resource files as folders(da, es, fr) under "MonoBundle" folder along with the .rtf files, inside the app.
Now if I check the project option to bundle mono along with the app file, both the resource folders & the rtf files are missing from the "Mono Bundle" folder. (Debug & Release)
I was able to find the rtf files in the "Resources" folder in the app.
But language resources are completely missing from the app.
Which means if mono is bundled along with my app(which is awesome), but then localization doesn't work anymore.
It prevents me from shipping the product with mono bundled.
Any idea why this is happening?!
Thanks.
Yep. XamMac.dll = Classic. Ok. That's good to know.
First of all, on your issue. It sounds like a bug in our packager. You can file a bug (https://bugzilla.xamarin.com), but let's focus on a work around.
It sounds like a number of files are not being copied into your bundle that you'd expect (and that localization expects). You could copy them in using a post build custom command. If you do that and plan on signing your bundle, you'll need to resign afterwards, since adding files will invalidate the signature.
Another option is to migrate/upgrade to Unified. We've made a significant number of improvements in many areas. I'm unsure without testing if we've fixed this specific issue, but since we use msbuild under the hood, it is easy to hook into the build to copy the files needed:
https://developer.xamarin.com/samples/mac/UseMSBuildToCopyFilesToBundleExample/
As I noted above, that sample only works with msbuild, which is how we build Unified (Xamarin.Mac.dll) projects. Classic (XamMac.dll) projects are built using a different system, which is not extendable in that manor.
If you want to stay on Classic, you'll need to add custom commands to copy the required files. If you open project options, Under build you'll see "Custom Commands". There you can add an after build command.
You can read about Unified vs Classic here - https://developer.xamarin.com/guides/cross-platform/macios/unified/
Answers
Hmm. You talk about "include mono runtime". That option only exists in Xamarin.Mac Classic (which you can't create new projects of, so doubtful), or the open source MonoMac bits.
Which are you using? We've made a huge number of changes since the MonoMac in Xamarin.Mac.
I'm using an existing project(from maybe more than a year), so I guessing the Classic version is what I'm working on.
XamMac is the reference used. Does that help?
Yep. XamMac.dll = Classic. Ok. That's good to know.
First of all, on your issue. It sounds like a bug in our packager. You can file a bug (https://bugzilla.xamarin.com), but let's focus on a work around.
It sounds like a number of files are not being copied into your bundle that you'd expect (and that localization expects). You could copy them in using a post build custom command. If you do that and plan on signing your bundle, you'll need to resign afterwards, since adding files will invalidate the signature.
Another option is to migrate/upgrade to Unified. We've made a significant number of improvements in many areas. I'm unsure without testing if we've fixed this specific issue, but since we use msbuild under the hood, it is easy to hook into the build to copy the files needed:
https://developer.xamarin.com/samples/mac/UseMSBuildToCopyFilesToBundleExample/
Thanks for the reply.
I tried the sample and looks like it is copying files over to the desired folder.
It doesnt seem to work with the project type I have. (I added the project entry as mentioned in the article page).
When I run the sample application I see "Target CopyOurFiles:" along with other Targets in the output window.
And looks like it is running multiple Targets.
But when I build my project I dont see Targets being run at all, and it says -
Building: [ProjectNames].
Do you know if I might have to change any other setting to get it working with the older project type I have?
As I noted above, that sample only works with msbuild, which is how we build Unified (Xamarin.Mac.dll) projects. Classic (XamMac.dll) projects are built using a different system, which is not extendable in that manor.
If you want to stay on Classic, you'll need to add custom commands to copy the required files. If you open project options, Under build you'll see "Custom Commands". There you can add an after build command.
You can read about Unified vs Classic here - https://developer.xamarin.com/guides/cross-platform/macios/unified/