Exception throwed by application constructor in windows phone 7 project

Jul 6, 2012 at 12:55 PM

Hi,

The application constructor

 

protected Application(string name, string contentDirectory);

 

throwed this arguement exception:

 

Value does not fall within the expected range.

My code is here:

 

        /// <summary>
        /// Creates a new instance of the game
        /// </summary>
        public Game()
            : base("Game", "Content")
        {
        }

The desktop project works fine.

How to deal with this?

 

Tanks first,

Xavior

Jul 9, 2012 at 9:08 AM

Could you pelase share the stack trace thrown with this exception? Thanks.

Jul 10, 2012 at 5:33 AM
Edited Jul 10, 2012 at 5:45 AM

Here it is:

StackTrace "   at Indiefreaks.Xna.Rendering.Camera.CameraManager.Clear()\r\n   at Indiefreaks.Xna.Rendering.Camera.CameraManager..ctor(IManagerServiceProvider sceneInterface)\r\n   at Indiefreaks.Xna.Core.Application.CreateSceneInterface()\r\n   at Indiefreaks.Xna.Core.Application.get_SunBurn()\r\n   at System.Globalization.CultureTableRecord..ctor(String cultureName, Boolean useUserOverride)\r\n   at System.Globalization.CultureTableRecord.GetCultureTableRecord(String name, Boolean useUserOverride)\r\n   at System.Globalization.CultureInfo..ctor(String name, Boolean useUserOverride)\r\n   at System.Globalization.CultureInfo..ctor(String name)\r\n   at Indiefreaks.Xna.Storage.StorageManager..ctor(Application application)\r\n   at Indiefreaks.Xna.Core.Application..ctor(String name, String contentDirectory, Language[] supportedLanguages)\r\n   at Indiefreaks.Xna.Core.Application..ctor(String name, String contentDirectory)\r\n   at EarthSquare.EarthSquare..ctor()\r\n   at System.Reflection.RuntimeConstructorInfo.InternalInvoke(RuntimeConstructorInfo rtci, BindingFlags invokeAttr, Binder binder, Object parameters, CultureInfo culture, Boolean isBinderDefault, Assembly caller, Boolean verifyAccess, StackCrawlMark& stackMark)\r\n   at System.Reflection.RuntimeConstructorInfo.InternalInvoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, StackCrawlMark& stackMark)\r\n   at System.Activator.InternalCreateInstance(Type type, Boolean nonPublic, StackCrawlMark& stackMark)\r\n   at System.Activator.CreateInstance(Type type)\r\n   at Microsoft.Xna.Framework.XnaGameApplication.InitializeGame(String entrypointAssemblyName, String entryPointAssemblyType)\r\n   at Microsoft.Xna.Framework.XnaGameApplication.XnaGameApplication_Startup(Object sender, StartupEventArgs e)\r\n   at MS.Internal.CoreInvokeHandler.InvokeEventHandler(Int32 typeIndex, Delegate handlerDelegate, Object sender, Object args)\r\n   at MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, Int32 actualArgsTypeIndex, String eventName)\r\n" string

Coordinator
Jul 10, 2012 at 7:54 PM

IGF v0.9.2.0 is built to support Xna WP7.1. What version of the framework are you using?

Jul 11, 2012 at 3:23 AM
indiefreaks wrote:

IGF v0.9.2.0 is built to support Xna WP7.1. What version of the framework are you using?

Im using IGF v0.9.2.0 and WP sdk 7.1 with 7.1.1 update

Jul 12, 2012 at 9:40 AM

That might be the reason then. If you can, simply get IGF source code (v0.9.2.0) and rebuild it for your needs. It should then run as expected.

Jul 12, 2012 at 5:02 PM
philippedasilva wrote:

That might be the reason then. If you can, simply get IGF source code (v0.9.2.0) and rebuild it for your needs. It should then run as expected.

Hi philip,

I've tried what you said but it still doesn't work.

No exception is captured and the application just quit.

I noticed that two exception shows in debug output:

System.ArgumentException in mscorlib.dll

and

System.InvalidOperationException in Microsoft.Xna.Framework.Game.dll

At least it works fine with WP7.1 without 7.1.1...

Thank you!