Going for adventure, lots of sun and a convertible! | GMT-8
Je kan in VS.NET specifieren dat de debugger moet breaken als er een exceptie gegooid wordt, ipv breaken op unhandled exceptions.
(Die exceptions die je in de log ziet, zijn wellicht excepties die door het framework gegooid zijn, en opgevangen & afgehandeld worden in het .net framework ? )
https://fgheysels.github.io/
Neen als de Exception zou afgevangen worden zou het programma normaal moeten doorwerken, maar dat doet het dus niet.whoami schreef op donderdag 26 februari 2009 @ 22:24:
Hoe bedoel je precies ?
Je kan in VS.NET specifieren dat de debugger moet breaken als er een exceptie gegooid wordt, ipv breaken op unhandled exceptions.
(Die exceptions die je in de log ziet, zijn wellicht excepties die door het framework gegooid zijn, en opgevangen & afgehandeld worden in het .net framework ? )
Waar kan je dat instellen?
Going for adventure, lots of sun and a convertible! | GMT-8
https://fgheysels.github.io/
Nop, daar is het niet.whoami schreef op donderdag 26 februari 2009 @ 22:27:
Debug / Exceptions dacht ik ... zo uit het blote hoofd.
Ik heb het iig over InvalidOperation Exceptions. Die worden alleen weergegeven in de console.
Going for adventure, lots of sun and a convertible! | GMT-8
A first chance exception of type 'System.FormatException' occurred in mscorlib.dll A first chance exception of type 'System.Reflection.TargetInvocationException' occurred in mscorlib.dll
Ik kan nu even geen code geven om het te reproduceren.
Going for adventure, lots of sun and a convertible! | GMT-8
Die dll handelt de fout zelf af en gaat gewoon verder.
Zelf heb ik al heel veel tijd verspilt daaraan, maar kreeg die exception niet weg.
Speel ook Balls Connect en Repeat
Maar als ik iets verander aan die lijst dan wordt in die dispatcher een Exception gegooid (logisch), (A first chance exception of type 'System.InvalidOperationException' occurred in PresentationCore.dll).
Maar ik zou dus willen dat de code daarop breekt, wat ie dus niet doet.
Ik weet bij dit voorbeeld waar het vandaan komt, maar dat duurt mij soms ZOOO lang om dat te vinden, en daar wil ik naar toe in dit topic: hoe zorg ik ervoor dat Visual Studio ook breekt op dit soort Exceptions.
Going for adventure, lots of sun and a convertible! | GMT-8
Ik heb m'n entity model in een dll zitten, en in een ander WPF project roep ik (in de constructor) dit op:
1
| this.entitiesVoetbal = new EntitiesVoetbal(); |
Nu heeft die een probleem het het vinden van het path naar de database ivm de app.config, sure enough, maar waarom komt er alleen maar een stomme exception (System.IO.FileNotFoundException) in de console te staan, terwijl dit toch echt een breaking issue is.
[ Voor 3% gewijzigd door Snake op 26-02-2009 23:18 ]
Going for adventure, lots of sun and a convertible! | GMT-8
1
| System.Diagnostics.Debugger.Break(); |
Het is wat omslachtig, maar dan breakt hij in ieder geval.
¸.·´¯`·.¸.·´¯`·.¸><(((º>¸.·´¯`·.¸><(((º>¸.·´¯`·.¸.·´¯`·.¸.·´¯`·.¸<º)))><¸.·´¯`·.¸.·´¯`·.¸.·´¯`·.¸
Je snapt het niet denk ik (nofi). Ik moet dan rond ieder statement / block een try catch gaan zetten.TheCoolGamer schreef op donderdag 26 februari 2009 @ 23:25:
Je zou het in een try..catch blok kunnen zetten met in de catch:
C#:
1 System.Diagnostics.Debugger.Break();
Het is wat omslachtig, maar dan breakt hij in ieder geval.
Going for adventure, lots of sun and a convertible! | GMT-8
¸.·´¯`·.¸.·´¯`·.¸><(((º>¸.·´¯`·.¸><(((º>¸.·´¯`·.¸.·´¯`·.¸.·´¯`·.¸<º)))><¸.·´¯`·.¸.·´¯`·.¸.·´¯`·.¸
Je kan, zoals whoami zegt kijken bij Debug > Exceptions en dan Common Language Runtime Exceptions. Die zou, als het goed is
Ik denk ook niet dat het aan code, try.. catch of wat dan ook ligt maar echt aan een of andere vage setting in je IDE.
Heart..pumps blood.Has nothing to do with emotion! Bored
Whoami, ik heb (natuurlijk) in het verkeerde menu gekeken, thankswhoami schreef op donderdag 26 februari 2009 @ 22:27:
Debug / Exceptions dacht ik ... zo uit het blote hoofd.
Ik ga nu even verder testen.
Edit: Dat zijn echt serieus veel Exceptions die dan gegooid worden.
Maar toch bedankt
[ Voor 14% gewijzigd door Snake op 27-02-2009 01:51 ]
Going for adventure, lots of sun and a convertible! | GMT-8
“Build a man a fire, and he'll be warm for a day. Set a man on fire, and he'll be warm for the rest of his life.”