The following exception is thrown whenever I attempt to load any Texture2d
Code:
background = Content.Load<Texture2D>("stars");
Exception:
08-18 23:20:51.334 I/MonoDroid( 4469): UNHANDLED EXCEPTION:
08-18 23:20:51.338 I/MonoDroid( 4469): Microsoft.Xna.Framework.Content.ContentLoadException: Could not load stars asset as a non-content file! ---> Microsoft.Xna.Framework.Content.ContentLoadException: Opening stream error. ---> Java.IO.FileNotFoundException: Exception of type 'Java.IO.FileNotFoundException' was thrown.
08-18 23:20:51.338 I/MonoDroid( 4469): at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000b] in /Users/builder/data/lanes/1978/f98871a9/source/mono/mcs/class/corlib/System.Runtime.ExceptionServices/ExceptionDispatchInfo.cs:61
08-18 23:20:51.338 I/MonoDroid( 4469): at Android.Runtime.JNIEnv.CallObjectMethod (IntPtr jobject, IntPtr jmethod, Android.Runtime.JValue* parms) [0x00064] in /Users/builder/data/lanes/1978/f98871a9/source/monodroid/src/Mono.Android/src/Runtime/JNIEnv.g.cs:195
08-18 23:20:51.338 I/MonoDroid( 4469): at Android.Content.Res.AssetManager.Open (System.String fileName) [0x0004b] in /Users/builder/data/lanes/1978/f98871a9/source/monodroid/src/Mono.Android/platforms/android-17/src/generated/Android.Content.Res.AssetManager.cs:88
08-18 23:20:51.338 I/MonoDroid( 4469): at Microsoft.Xna.Framework.TitleContainer.OpenStream (System.String name) [0x00024] in <filename unknown>:0 08-18 23:20:51.338 I/MonoDroid( 4469): at Microsoft.Xna.Framework.Content.ContentManager.OpenStream (System.String assetName) [0x00017] in <filename unknown>:0
08-18 23:20:51.338 I/MonoDroid( 4469): --- End of managed exception stack trace ---
The image file is in the “Content” folder and has Build Action:Content, Copy to Output Directory: Copy if newer
I see the following in the build log:
1>C:\Users\#\documents\visual studio 2015\Projects\game\game\Content\stars.jpg : warning XA0101: @(Content) build action is not supported
How can I fix this?
Thanks