Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What this error mean ? Inconsistent accessibility: field type 'DannyGeneral.OptionsFile' is less accessible than field 'AnimationEditor.Form1

Tags:

c#

Inconsistent accessibility: field type 'DannyGeneral.OptionsFile' is less accessible than field 'AnimationEditor.Form1.setting_file'

In Form1 i did:

public  OptionsFile setting_file;

The error is on the setting_file part.

This is the beginning of the Options_File code:

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Net;
using System.IO;
using System.Configuration;




namespace DannyGeneral
{
    class OptionsFile
    {

        string path_exe;
        string temp_settings_file;
        string temp_settings_dir;
        string Options_File;
        StreamWriter sw;
        StreamReader sr;


    public OptionsFile(string settings)
    {
        if (!File.Exists(settings))
        {
            if (!Directory.Exists(Path.GetDirectoryName(settings)))
            {
                Directory.CreateDirectory(Path.GetDirectoryName(settings));
            }
            File.Create(settings).Close();
        }
        path_exe = Path.GetDirectoryName(Application.LocalUserAppDataPath);
        Options_File = settings; 
    }

And In Form1 the top:

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.IO;
using DannyGeneral;
using unfreez_wrapper;

namespace AnimationEditor
{
    public partial class Form1 : Form
    {
        private static string settings_dir;
        private static string settings_file;
        public  OptionsFile setting_file;
like image 704
user1477444 Avatar asked Dec 20 '22 19:12

user1477444


1 Answers

You need to have the type OptionsFile itself be public if you want to use it as a public property.

Restrictions on Using Accessibility Levels (C# Reference)

like image 152
500 - Internal Server Error Avatar answered May 20 '23 21:05

500 - Internal Server Error