TargetInvocationException
by Alienforce · in Torque X 3D · 11/07/2006 (6:22 am) · 16 replies
When i try to compile/run the Tankbuster demo i get a "TargetInvocationException" > TankBuster.exe!GarageGames.Torque.Examples.TankBuster.Game.BeginRun() Line 180 C#
Anyone have an idea how to fix this ?
Anyone have an idea how to fix this ?
#2
Microsoft Visual Studio 2005
Version 8.0.50727.42 (RTM.050727-4200)
Microsoft .NET Framework
Version 2.0.50727
Installed Edition: C# Express
Microsoft Visual C# 2005 76544-000-0000011-00126
Microsoft Visual C# 2005
Microsoft XNA Game Studio Express (Beta 2) 1.0
Microsoft XNA Game Studio Express (Beta 2) Version 1.0
PS. Spacewar starterkit works/compiles without any problems.
11/07/2006 (8:17 am)
Yes, I hope so :)Microsoft Visual Studio 2005
Version 8.0.50727.42 (RTM.050727-4200)
Microsoft .NET Framework
Version 2.0.50727
Installed Edition: C# Express
Microsoft Visual C# 2005 76544-000-0000011-00126
Microsoft Visual C# 2005
Microsoft XNA Game Studio Express (Beta 2) 1.0
Microsoft XNA Game Studio Express (Beta 2) Version 1.0
PS. Spacewar starterkit works/compiles without any problems.
#3
try{ line 180 }catch(Exception ex){ MessageBox.Show(//ex...ToString()); //use intellisence to find a usefull method }
I have gotten it before when i dynamically loaded a .dll from managed code and then running the .dll i loaded. When an exception occurrences in the dynamically loaded dll instead of getting the exception message from the .dll you get your "TargetInvocationException".
With out being on your system thats the most help i can give you.
11/07/2006 (8:59 am)
This exception means that something somewhere else threw an exception. I know thats about as helpfull as mud, and i'm sorry. I would suggest putting a try{ line 180 }catch(Exception ex){ MessageBox.Show(//ex.
I have gotten it before when i dynamically loaded a .dll from managed code and then running the .dll i loaded. When an exception occurrences in the dynamically loaded dll instead of getting the exception message from the .dll you get your "TargetInvocationException".
With out being on your system thats the most help i can give you.
#4
11/07/2006 (10:32 am)
Likely the XML deserializer threw the exception. It would be great if you can provide a stack trace. Have you modified the XML file at all?
#5
11/07/2006 (10:38 am)
System.ArgumentException was unhandled
Message="En post med samma nyckel har redan lagts till."
Source="mscorlib"
StackTrace:
vid System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
vid System.Collections.Generic.Dictionary'2.Insert(TKey key, TValue value, Boolean add)
vid System.Collections.Generic.Dictionary'2.Add(TKey key, TValue value)
vid GarageGames.Torque.Core.Xml.TorqueXmlDeserializer._AddDefaultTypes()
vid GarageGames.Torque.Core.Xml.TorqueXmlDeserializer.Process(String levelFile, Object target)
vid GarageGames.Torque.Core.Xml.LevelData.LoadLevel(String filename, Assembly executingAssembly)
vid GarageGames.Torque.Core.Xml.LevelData.LoadLevel(String filename)
vid GarageGames.Torque.Examples.TankBuster.Game.BeginRun() i C:\Program\TorqueXBeta-1.0b1\Torque X Beta\Examples\TankBuster\Game.cs:rad 180
vid Microsoft.Xna.Framework.Game.Run()
vid GarageGames.Torque.Examples.TankBuster.GameStarter.Main(String[] args) i C:\Program\TorqueXBeta-1.0b1\Torque X Beta\Examples\TankBuster\Main.cs:rad 22
#6
11/07/2006 (4:45 pm)
TorqueCrashException.txtSystem.Reflection.TargetInvocationException: Ett undantagsfel har intraffat i malet for en aktivering. ---> System.FormatException: Indatastrangen hade ett felaktigt format. vid System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal) vid System.Number.ParseSingle(String value, NumberStyles options, NumberFormatInfo numfmt) vid System.Single.Parse(String s, NumberStyles style, NumberFormatInfo info) vid System.Single.Parse(String s) --- Slut pa stacksparning for interna undantag --- vid System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner) vid System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner) vid System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks) vid System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) vid System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters) vid GarageGames.Torque.Core.Xml.TorqueXmlDeserializer.GetPrimitiveValue(Type primitiveType, String strValue) vid GarageGames.Torque.Core.Xml.TorqueXmlDeserializer.SetFieldOrProperty(IFieldOrProperty fieldOrProperty, XmlNode element, Object& o) vid GarageGames.Torque.Core.Xml.TorqueXmlDeserializer.Recurse(XmlNode element, Object& o, TypeInfo ti) vid GarageGames.Torque.Core.Xml.TorqueXmlDeserializer.SetFieldOrProperty(IFieldOrProperty fieldOrProperty, XmlNode element, Object& o) vid GarageGames.Torque.Core.Xml.TorqueXmlDeserializer.Recurse(XmlNode element, Object& o, TypeInfo ti) vid GarageGames.Torque.Core.Xml.TorqueXmlDeserializer.RecurseFolder(XmlNode element, DeserializedList& list, TypeInfo ti) vid GarageGames.Torque.Core.Xml.TorqueXmlDeserializer.SetFieldOrProperty(IFieldOrProperty fieldOrProperty, XmlNode element, Object& o) vid GarageGames.Torque.Core.Xml.TorqueXmlDeserializer.Recurse(XmlNode element, Object& o, TypeInfo ti) vid GarageGames.Torque.Core.Xml.TorqueXmlDeserializer.Process(String levelFile, Object target) vid GarageGames.Torque.Core.Xml.LevelData.LoadLevel(String filename, Assembly executingAssembly) vid GarageGames.Torque.Core.Xml.LevelData.LoadLevel(String filename) vid GarageGames.Torque.Examples.TankBuster.Game.BeginRun() i C:\Program\TorqueXBeta-1.0b1\Torque X Beta\Examples\TankBuster\Game.cs:rad 180 vid Microsoft.Xna.Framework.Game.Run() vid GarageGames.Torque.Examples.TankBuster.GameStarter.Main(String[] args) i C:\Program\TorqueXBeta-1.0b1\Torque X Beta\Examples\TankBuster\Main.cs:rad 26
#7
11/07/2006 (5:56 pm)
That is really weird stuff. I wonder if you have a virus or something? The strings that it is complaining about don't even exist in our framework. Do you have a virus scanner running?
#8
I will do a complete virus and system check to see whats going on :/
11/08/2006 (3:51 am)
I am running Avast Vs4.7I will do a complete virus and system check to see whats going on :/
#9
11/08/2006 (5:12 am)
Maybe a bit of bug detection could be added to the TorqueXmlDeserializer, just enough so that you know what the value / object it was attempting to deserialize when it crashed?
#10
Can it have something todo with running on a "Swedish" OS, xp pro sr2 ?
I am kind of clueless and dont know where to start "debugging" since everything is nonmodified and freshed installed.
11/08/2006 (9:53 am)
Cant find anything wrong on my usual develop machine, and i moved the release compile over to our "test" machine and it gives the same problem when executed.Can it have something todo with running on a "Swedish" OS, xp pro sr2 ?
I am kind of clueless and dont know where to start "debugging" since everything is nonmodified and freshed installed.
#11
Remove .net 2.0 framework, C# express, XNA Framework, and Game Studio Express.
Redownload the latest version of each.
Install the .net framework, then XNA framework, then C# express, then Game Studio Express.
Try to open and run the project without modifying anything.
This exception usually means that your applications has attempted (directly or indirectly) to call a method via reflection and the arguments you provide do not match the signature of the method. If you haven't modified anything in the download and the above doesn't work, then delete the TXE and redownload and reinstall it and try again.
You may want to turn on English as the language pack and then recompile so we can see the english version of the text you've entered.
11/08/2006 (12:48 pm)
@Alien - Are you certain you have the latest version of Visual C#.net 2005 Express? This is what I would do:Remove .net 2.0 framework, C# express, XNA Framework, and Game Studio Express.
Redownload the latest version of each.
Install the .net framework, then XNA framework, then C# express, then Game Studio Express.
Try to open and run the project without modifying anything.
This exception usually means that your applications has attempted (directly or indirectly) to call a method via reflection and the arguments you provide do not match the signature of the method. If you haven't modified anything in the download and the above doesn't work, then delete the TXE and redownload and reinstall it and try again.
You may want to turn on English as the language pack and then recompile so we can see the english version of the text you've entered.
#12
Ett undantagsfel har intraffat i malet for en aktivering.
and
Indatastrangen hade ett felaktigt format
11/08/2006 (12:55 pm)
Better yet, can you translate the following lines:Ett undantagsfel har intraffat i malet for en aktivering.
and
Indatastrangen hade ett felaktigt format
#13
Not to say that Jon is wrong but as all of the code is in a few .dll's i doubt an un-install and re-install would help.
11/08/2006 (1:11 pm)
The error is occurring as its trying to deserialize the data out of the XML file. i guess this could be caused by the language barrier... (i have no clue how C# handles text ala unicode or ascii or w/e)Not to say that Jon is wrong but as all of the code is in a few .dll's i doubt an un-install and re-install would help.
#14
The issue might happen when it's deserializing, but it's happening due to the fact that an object, possibly one it's trying to deserialize into, doesn't exist. The words I pasted above are the actual full blown error, but are in swedish or something, so I can't read them and the translaters go crazy.
XNA is all in english, but is supported for all language packs. Does this include other versions of XP Pro like the Swedish one? I don't know, but it sounded like it should.
Translate the above and do the reinstalls just to be safe.
11/08/2006 (1:15 pm)
When in doubt, reinstall. Tricks of the trade. You do it just to make sure you didn't get some corruption along the way.The issue might happen when it's deserializing, but it's happening due to the fact that an object, possibly one it's trying to deserialize into, doesn't exist. The words I pasted above are the actual full blown error, but are in swedish or something, so I can't read them and the translaters go crazy.
XNA is all in english, but is supported for all language packs. Does this include other versions of XP Pro like the Swedish one? I don't know, but it sounded like it should.
Translate the above and do the reinstalls just to be safe.
#15
"Ett undantagsfel har intraffat i malet for en aktivering."
A systemerror has happend/occured in the target for a exection
"Indatastrangen hade ett felaktigt format"
inputstring had a wrong format
I will do a fresh web install also of Visual C# later on tonight.
And thanks for all the input so far!
11/08/2006 (4:42 pm)
01:37 AM Translation :)"Ett undantagsfel har intraffat i malet for en aktivering."
A systemerror has happend/occured in the target for a exection
"Indatastrangen hade ett felaktigt format"
inputstring had a wrong format
I will do a fresh web install also of Visual C# later on tonight.
And thanks for all the input so far!
#16
Only one thing left, Try it on a new formated and fresh installed system.
11/09/2006 (4:53 pm)
:( Not working. Updated and reinstalled Visual C# and XNA ...Only one thing left, Try it on a new formated and fresh installed system.
Torque 3D Owner Florian Ross