Git Product home page Git Product logo

Comments (3)

NameOfTheDragon avatar NameOfTheDragon commented on August 23, 2024

Follow-up. While I was completing my issue report, I had left my debug session suspended at the NullReferenceException.
image

The stack trace looks like this
image

I had a look at the SettingsProvider code and I think I see a possible failure mechanism. Here's the relevant code in the SettingsProvider:

                try
                {
                    string value = ascomProfile.GetValue(deviceId, item.Name, null, String.Empty);
                    if (String.IsNullOrEmpty(value))
                    {
                        spv.SerializedValue = item.DefaultValue; //[ASCOM-256]
                        Diagnostics.TraceVerbose("Defaulted/empty ASCOM Profile DeviceID={0}, Key={1}, Value={2}",
                                                 deviceId, item.Name, item.DefaultValue.ToString());
                    }
                    else
                    {
                        spv.SerializedValue = value;
                        Diagnostics.TraceVerbose("Retrieved ASCOM Profile DeviceID={0}, Key={1}, Value={2}", deviceId,
                                                 item.Name, value);
                    }
                }
                catch
                {
                    spv.SerializedValue = spv.Property.DefaultValue;
                    Diagnostics.TraceVerbose("Defaulted/missing ASCOM Profile DeviceID={0}, Key={1}, Value={2}",
                                             deviceId, item.Name, spv.PropertyValue);
                }

The exception appears to be happening on the first line of my try {} block. SettingsProvider expects a null or empty string if there is no saved setting - but instead, it gets an exception (this might be a change in behaviour in Profile from previous releases).

This might only be an issue when debugging because the debugger halts on the exception, which is leaving the mutex locked, so any ASCOM apps that launch at that point will fail. However something has changed because I've never seen this issue before when debugging and both @DanielVanNoord and I have seen it on 6.5 RC builds.

from ascomplatform.

Peter-Simpson avatar Peter-Simpson commented on August 23, 2024

from ascomplatform.

NameOfTheDragon avatar NameOfTheDragon commented on August 23, 2024

I agree. Also as pointed out by @astroman133 , Visual Studio seems to be suddenly more alert to exceptions that it previously ignored. Problem solved by ticking this checkbox...
image

from ascomplatform.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.