c# - Set property 'System.Windows.FrameworkElement.Height' threw an exception -
c# - Set property 'System.Windows.FrameworkElement.Height' threw an exception -
an in-house application coded in c# , wpf works without incident 20+ people except 1 user. first window displayed (but not always) results in exception our exception handler diligently reports:
exception trace: set property 'system.windows.frameworkelement.height' threw exception. overflow or underflow in arithmetic operation. stack trace: @ system.windows.markup.wpfxamlloader.load(xamlreader xamlreader, ixamlobjectwriterfactory writerfactory, boolean skipjournaledproperties, object rootobject, xamlobjectwritersettings settings, uri baseuri) @ system.windows.markup.wpfxamlloader.loadbaml(xamlreader xamlreader, boolean skipjournaledproperties, object rootobject, xamlaccesslevel accesslevel, uri baseuri) @ system.windows.markup.xamlreader.loadbaml(stream stream, parsercontext parsercontext, object parent, boolean closestream) @ system.windows.application.loadbamlstreamwithsyncinfo(stream stream, parsercontext pc) @ system.windows.application.loadcomponent(uri resourcelocator, boolean bskipjournaledproperties) @ system.windows.application.dostartup() @ system.windows.application.<.ctor>b__1(object unused) @ system.windows.threading.exceptionwrapper.internalrealcall(delegate callback, object args, int32 numargs) @ ms.internal.threading.exceptionfilterhelper.trycatchwhen(object source, delegate method, object args, int32 numargs, delegate catchhandler)
there's no obvious problem xaml, , i'm never straight touching height of element. i've tried making window default larger or smaller size, hasn't resolved anything. it's simple user log in window. problem not goes away after goes away on reboot.
i don't expect silver bullet problem, it's not clear should begin in debugging -- wpf seems have design flaw makes impossible debug such exceptions?
after searching 1 time again abbas suggested, solution ended with:
/// <summary> /// interaction logic app.xaml /// </summary> public partial class app : application { [dllimport("msvcr71.dll", callingconvention = callingconvention.cdecl)] private static extern int _controlfp(int n, int mask); private void application_startup(object sender, startupeventargs e) { _controlfp(0x9001f, 0xfffff); // ... whatever else want on application startup // e.g. add together last-resort error handler via dispatcherunhandledexception } }
some software apparently can leave floating point calculation modes in unexpected state. _controlfp
phone call sets expected mode.
c# wpf
Comments
Post a Comment