Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
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
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.
1. Create an empty MonoGame "universal" iOS/Android project.
2. Right-click on the Content folder inside of <Android Project>/Assets/Content/, and select Add Files...
3. Add a .xnb file (such as robot.xnb)
4. Right-click and go to Properties on this newly-added file
5. Notice that the "Build action" is set to "AndroidAsset" (this is correct behavior)
6. Right-click on the Content folder inside of <iOS Project>/Content, and select Add Files...
7. Add a .xnb file (such as robot.xnb)
8. Right-click and go to Properties on this newly-added file
9. Notice that the "Build action" is set to "None"
Actual Behavior: Build action for iOS projects is "None
Expected Behavior: Build action should be "BundleResource"
Note, this is the opposite of this older bug that I posted:
The following .zip file contains .xnb files which can be added:
This bug occurs in a very common path for MonoGame users.
Android does not have special support for .xnb files. What is happening for Android is that the Assets folder in the project is treated as a special folder and if a file is added to that folder then it automatically gets the build action of AndroidAsset.
iOS has some special folders but Content is not one of them as far as I am aware. For example, if you add a .xnb file to the Resources folder then it will have a build action of BundleResource.
You can also override the default build action when the file is added but that will not help if you do not know what build action to choose.
The "None" build action was not iOS-specific, it was the default value for unknown file types.
I've changed Mac and iOS to override "None" to be "BundleResource" but I don't know if that's really expected behavior.
If you added those files to the Resources folder or the top-level project folder, they would have defaulted to "BundleResource".