exception error!

Oct 21, 2008 at 1:11 PM

When running any demo program after comilation, I get this error:

--

System.TypeInitializationException was unhandled
  Message="The type initializer for 'Ox.Core.OxConsts' threw an exception."
  Source="Ox.Gui"
  TypeName="Ox.Core.OxConsts"
  StackTrace:
       at Ox.Gui.GuiServices.CreateGuiCamera() in C:\Work\xna\3d engines\Ox\Ox.Gui\GuiServices.cs:line 397
       at Ox.Gui.GuiServices..ctor(IOxServices services, IGuiEditorPlugin guiEditorPlugin, IGuiViewFactory guiViewFactory) in C:\Work\xna\3d engines\Ox\Ox.Gui\GuiServices.cs:line 147
       at GuiDemo.Application..ctor() in C:\Work\xna\3d engines\Ox\GuiDemo\Application.cs:line 51
       at GuiDemo.Program.Main(String[] args) in C:\Work\xna\3d engines\Ox\GuiDemo\Program.cs:line 12
--

Any ideas? I'm quite new with xna, so I don't fully understand how to fix this. I couldn't find anything wrong with the code.
I have not done anything to the code otherwise. Using visual express 2005 with xna 2.0.

Thanks for any help!! I'm doing a short project until monday and need to decide on an 3d engine faaaaast. This looks complete and good enough for this.

Coordinator
Oct 21, 2008 at 9:58 PM
Edited Oct 22, 2008 at 1:34 AM
Hi Rockard!

It sounds like something happened to your OxConsts.txt configuration file. You get this error when OxConsts can't read in its variables from OxConsts.txt properly. I tried to reproduce the error with a clean download, but cannot. I think you'll just have to try to debug it. To do so, set a breakpoint on line 16 in Ox.Core.OxConsts.cs and step through to find the problem. It should be relatively easy to figure out :)

Wish I could tell ya more :)
Oct 21, 2008 at 11:05 PM

Hmm.. seems it isn't the textfile. Since, if I remove it, the project won't compile. I tried debugging, and it loaded in fine - the text was read into variables.
What may be of importance, is that the error occurs before leaving the initiation of oxConsts, the same function you told me to watch.
Later on, the program step into the function in this line:
SafeZoneMultiplier = float.Parse(dataBank["SafeZoneMultiplier"]);
and in the end reaches this line in the CreateGuiCamera:
result.Position = new Vector3( OxConsts.VirtualViewport.Width * 0.5f, 1, OxConsts.VirtualViewport.Height * 0.5f);
where it dies as usual.

Any ideas?

It's weird. I also have downloaded the clean project and haven't changed anything.

Coordinator
Oct 22, 2008 at 12:49 AM
Oh, I'm not saying that the file is missing - I'm saying that it's not being read in properly. Paste the contents of the file in this thread please.
Oct 22, 2008 at 1:57 AM
oh sorry, my bad!

Anyway, the file looks like this:
--
Platform = Any
Development = true
VirtualViewport = 0, 0, 1280, 720
SafeZoneMultiplier = 0.9
--

Looks correct?

Also, as I hover the mouse over "OxConsts.VirtualViewport.Width" just before I step on it,
I see that data is in place as it should. But then, the error as I have described happens anyway.

This is so weird. Any more ideas?

I will try again tomorrow with the original workspace and files yet again to make sure I'm not wasting your time.
Coordinator
Oct 22, 2008 at 2:22 AM
Yeah, it looks right...

I just went ahead and put together a new build.

If the same problem happens with the new build, please try stepping into the call that is throwing the exception. Alternatively, using the exception view window that pops up when the error happens, navigate to the deepest InnerException property and paste it here :)

Thanks for your help so far in tracking down this bug :)
Oct 22, 2008 at 2:47 PM

Hello!

Just downloaded the new version.

I unpack, and compile.
I get these errors:

---------------

Compiled and got "deployment errors" and some warnings:
Error    1    No Xbox 360 console is available for deployment. Add an Xbox 360 console using the XNA Game Studio Device Center.        0    0    
Error    2    No Xbox 360 console is available for deployment. Add an Xbox 360 console using the XNA Game Studio Device Center.        0    0    
Error    3    No Xbox 360 console is available for deployment. Add an Xbox 360 console using the XNA Game Studio Device Center.        0    0    
Error    4    No Xbox 360 console is available for deployment. Add an Xbox 360 console using the XNA Game Studio Device Center.        0    0    
Warning    5    Asset was built 2 times with different settings:
using TextureImporter and TextureProcessor
using TextureImporter and TextureProcessor, referenced by Models\cube.X (ModelProcessor)    C:\Work\xna\3d engines\Ox\Ox.Core\Models\Finishes.Flooring.Rug.Braided.Bump.png    Ox.Core
Warning    6    Asset was built 2 times with different settings:
using TextureImporter and TextureProcessor
using TextureImporter and TextureProcessor, referenced by AnonymousBall\anonymousBall.X (ModelProcessor)    C:\Work\xna\3d engines\Ox\Ox.Example\AnonymousBall\Finishes.Flooring.Rug.Braided.Bump.png    Ox.Example
Warning    7    Asset was built 2 times with different settings:
using TextureImporter and TextureProcessor
using TextureImporter and TextureProcessor, referenced by Models\cube.X (ModelProcessor)    C:\Work\xna\3d engines\Ox\Ox.Core\Models\Finishes.Flooring.Rug.Braided.Bump.png    Xbox 360 Copy of Ox.Core
Warning    8    Asset was built 2 times with different settings:
using TextureImporter and TextureProcessor
using TextureImporter and TextureProcessor, referenced by AnonymousBall\anonymousBall.X (ModelProcessor)    C:\Work\xna\3d engines\Ox\Ox.Example\AnonymousBall\Finishes.Flooring.Rug.Braided.Bump.png    Xbox 360 Copy of Ox.Example

----------

I removed 360 related project files and recompile.

got these two warnings:

----

Warning    1    Asset was built 2 times with different settings:
using TextureImporter and TextureProcessor
using TextureImporter and TextureProcessor, referenced by Models\cube.X (ModelProcessor)    C:\Work\xna\3d engines\Ox\Ox.Core\Models\Finishes.Flooring.Rug.Braided.Bump.png    Ox.Core
Warning    2    Asset was built 2 times with different settings:
using TextureImporter and TextureProcessor
using TextureImporter and TextureProcessor, referenced by AnonymousBall\anonymousBall.X (ModelProcessor)    C:\Work\xna\3d engines\Ox\Ox.Example\AnonymousBall\Finishes.Flooring.Rug.Braided.Bump.png    Ox.Example

---

When running, the same exception occurs.

--

System.TypeInitializationException was unhandled
  Message="The type initializer for 'Ox.Core.OxConsts' threw an exception."
  Source="Ox.Gui"
  TypeName="Ox.Core.OxConsts"
  StackTrace:
       at Ox.Gui.GuiServices.CreateGuiCamera() in C:\Work\xna\3d engines\Ox\Ox.Gui\GuiServices.cs:line 397
       at Ox.Gui.GuiServices..ctor(IOxServices services, IGuiEditorPlugin guiEditorPlugin, IGuiViewFactory guiViewFactory) in C:\Work\xna\3d engines\Ox\Ox.Gui\GuiServices.cs:line 147
       at CharacterDemo.Application..ctor() in C:\Work\xna\3d engines\Ox\CharacterDemo\Application.cs:line 38
       at CharacterDemo.Program.Main(String[] args) in C:\Work\xna\3d engines\Ox\CharacterDemo\Program.cs:line 12

--

also, I checked the inner exception.
Since visual wouldnt let me copy everything at once, I made a screenshot:
http://img515.imageshack.us/my.php?image=exceptionie3.jpg

Hope it helps.
I want to try it out d*mmit!! =)





Coordinator
Oct 22, 2008 at 3:31 PM
Edited Oct 22, 2008 at 3:37 PM
Those errors are not build errors. It's just visual studio express being stupid and not realizing the Build != Deploy. Visual Studio 2005 Pro does not exhibit this behavior. You'll notice it says "Build Succeeded" despite these "error" messages. Simply ignore them as they do not stop anything from building.

The warnings do not matter either. Ignore them as well.

Better throw away the version you modified and unpack anew.

I looked at the screen shot. It looks like there is a problem when float.Parse is called. As to why you are encountering an error with float.Parse parsing "0.9", I don't have a clue. It's simply not doing what it's supposed to be doing on your setup, and I don't know why . Maybe your .NET installation is messed up or incomplete?

Is there anyone else who is getting this same issue?
Nov 3, 2008 at 9:10 AM
Edited Nov 3, 2008 at 9:13 AM
I  have the same problem with VS 2005 Pro. No matter if it is debug or release version. I deployed both Ox and OxNonExpress solution scratch from zero. I was trying to deploy pc version ... not xbox 360
Coordinator
Nov 4, 2008 at 7:03 AM
Edited Nov 4, 2008 at 7:06 AM
Alright, I've finally come up with an idea for you guys to try. Put a new line at the bottom of your OxConsts.txt file, then see what happens. I'm postulating that the problem is that the end of file character is being weirdly interpreted for some reason...

Good luck!
Coordinator
Dec 4, 2008 at 11:32 PM
Hey guys!

Thanks to RuZiggy, I realized your issue is due to the regional variance in how float.Parse works; IE, it wants a comma for decimal point rather than a period. I have released a new build with changes in the hopes that this variance no longer applies and it just works. Please download the new build, and let me know if it runs okay.

Thank you guys!