Crash Report showing wrong OS

Hello,
with SA 7 a CrashReport is showing Windows 8 as OS. But the crash is happening on a Windows 10 machine.
Could this been fixed?
Tagged:

Best Answer

Answers

  • mrmiagi0101mrmiagi0101 Posts: 20 Bronze 1
    You could do something like that to better get Windows Version:


    public static string GetOSVersion()
            {
                try
                {
                    var mo = GetManagementObject("Win32_OperatingSystem");

                    if (null == mo)
                        return string.Empty;

                    return mo["Caption"] + " (" + mo["Version"] + ") - " + mo["OSArchitecture"];
                }
                catch (Exception)
                {
                    return string.Empty;
                }
            }

            private static ManagementObject GetManagementObject(string className)
            {
                var mClass = new ManagementClass(className);
                foreach (var o in mClass.GetInstances())
                {
                    if (o is ManagementObject mObj) return mObj;
                }

                return null;
            }

  • Alex BAlex B Posts: 1,131 Diamond 4
    Hi @mrmiagi0101,

    I believe this will be down to not having a manifest file for your application - please see this forum post: https://forum.red-gate.com/discussion/81013/feature-usage-windows-10-detection#latest 

    Kind regards,
    Alex
    Product Support Engineer | Redgate Software

    Have you visited our Help Center?
  • mrmiagi0101mrmiagi0101 Posts: 20 Bronze 1
    Yes I know this, but with the above lines of code you get better infos. Have a look at this report in the custom properties section. No manifest needed.


  • Alex BAlex B Posts: 1,131 Diamond 4
    Hi @mrmiagi0101,

    I see what you mean.  I'll pass this on to the development team for their consideration and input! 

    In the meantime for anyone else coming upon this - you will need a manifest file for the correct OS information to be shown currently in SmartAssembly error reports.

    Kind regards,
    Alex
    Product Support Engineer | Redgate Software

    Have you visited our Help Center?
  • mrmiagi0101mrmiagi0101 Posts: 20 Bronze 1
    It seems to work now. Thanks.
  • Alex BAlex B Posts: 1,131 Diamond 4
    Hi @mrmiagi0101,

    Excellent, thank you for confirming!

    Kind regards,
    Alex
    Product Support Engineer | Redgate Software

    Have you visited our Help Center?
Sign In or Register to comment.