// Called by the shell to let the package write user options under the specified key.
        public int WriteUserOptions(IStream pOptionsStream, string _)
        {
            try
            {
                using (var stream = new DataStreamFromComStream(pOptionsStream))
                {
                    _serializer.Serialize(stream, _settings);
                }
            }
            catch
            {
            }

            return(VSConstants.S_OK);
        }
        // Called by the shell if the _strSolutionUserOptionsKey section declared in LoadUserOptions() as
        // being written by this package has been found in the suo file
        public int ReadUserOptions(IStream pOptionsStream, string _)
        {
            _settings = new NuGetSettings();

            try
            {
                using (var stream = new DataStreamFromComStream(pOptionsStream))
                {
                    NuGetSettings settings = _serializer.Deserialize(stream);

                    if (settings != null)
                    {
                        _settings = settings;
                    }
                }
            }
            catch
            {
            }

            return(VSConstants.S_OK);
        }