How do I resolve this CS1061 error?

Saga 431 Reputation points
2023-07-13T21:53:14.1066667+00:00

Hi all. I am using VS2019 with Windows 10.

My Outlook Add-In project is getting the following error:

		Properties.Settings.Default.SnippetList.Length	error CS1061: 'PropertyStore' does not contain a definition for 'Settings' and no accessible extension method 'Settings' accepting a first argument of type 'PropertyStore' could be found (are you missing a using directive or an assembly reference?)	

This is the code I am using:

           if (Properties.Settings.Default.SnippetList.Length > 0)   //Error here
                 using (MemoryStream ms = new    
                   MemoryStream(Convert.FromBase64String(Properties.Settings.Default.SnippetList)))                     
                 {
                     BinaryFormatter bf = new BinaryFormatter();
                     return (List<clsSnippets>)bf.Deserialize(ms);
                 }


I understand the error, but I don't know why I am getting it here. The SnippetList item exists in Settings. After looking in Solution Explorer, I found that Settings repeats twice; once in the Properties folder and again in the main folder. Is this correct? Any advice is appreciated, thanks. Here is an image of the Solution Explorer:

SE

Microsoft 365 and Office | Development | Other
Developer technologies | C#
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.