Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. is inaccessible due to its protection level

is inaccessible due to its protection level

Scheduled Pinned Locked Moved C#
csharphtmlcssasp-netdocker
2 Posts 2 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    dterry458
    wrote on last edited by
    #1

    I am getting the following error when trying to compile this code: H:\Grid Project\Alchemi-1.0.4-src\src\Alchemi.ManagerServiceController\ManagerMainForm.cs(61): 'ManagerTemplateForm.components' is inaccessible due to its protection level Here is the code that I am working with. I have a comment on the line where the error is thrown.

    #region Alchemi copyright and license notice

    /*
    * Alchemi [.NET Grid Computing Framework]
    * http://www.alchemi.net
    *
    * Title : ManagerMainForm.cs
    * Project : Alchemi Manager Application
    * Created on : 2003
    * Copyright : Copyright © 2006 The University of Melbourne
    * This technology has been developed with the support of
    * the Australian Research Council and the University of Melbourne
    * research grants as part of the Gridbus Project
    * within GRIDS Laboratory at the University of Melbourne, Australia.
    * Author : Akshay Luther (akshayl@csse.unimelb.edu.au), Rajkumar Buyya (raj@csse.unimelb.edu.au), and Krishna Nadiminti (kna@csse.unimelb.edu.au)
    * License : GPL
    * This program is free software; you can redistribute it and/or
    * modify it under the terms of the GNU General Public
    * License as published by the Free Software Foundation;
    * See the GNU General Public License
    * (http://www.gnu.org/copyleft/gpl.html) for more details.
    *
    */
    #endregion

    using System;
    using System.ComponentModel;
    using System.Reflection;
    using System.ServiceProcess;
    using System.Threading;
    using System.Windows.Forms;
    using Alchemi.Core;
    using Alchemi.Core.Manager;
    using Alchemi.Manager;
    using log4net;

    // Configure log4net using the .config file
    [assembly: log4net.Config.XmlConfigurator(Watch=true)]

    namespace Alchemi.ManagerService
    {
    public class ManagerMainForm : ManagerTemplateForm
    {
    public const string serviceName = "Alchemi Manager Service";

    	public ManagerMainForm():base()
    	{
    		InitializeComponent();
    		this.Text = "Alchemi Manager Service Controller";
    		Logger.LogHandler += new LogEventHandler(LogHandler);
    	}
    
    	#region Windows Form Designer generated code
    	/// /// Required method for Designer support - do not modify
    	/// the contents of this method with the code editor.
    	/// 
    	private void InitializeComponent()
    	{
    		this.components = new System.ComponentModel.Container(); **//Here is where it errors out at**
    		System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(ManagerMainFo
    
    B 1 Reply Last reply
    0
    • D dterry458

      I am getting the following error when trying to compile this code: H:\Grid Project\Alchemi-1.0.4-src\src\Alchemi.ManagerServiceController\ManagerMainForm.cs(61): 'ManagerTemplateForm.components' is inaccessible due to its protection level Here is the code that I am working with. I have a comment on the line where the error is thrown.

      #region Alchemi copyright and license notice

      /*
      * Alchemi [.NET Grid Computing Framework]
      * http://www.alchemi.net
      *
      * Title : ManagerMainForm.cs
      * Project : Alchemi Manager Application
      * Created on : 2003
      * Copyright : Copyright © 2006 The University of Melbourne
      * This technology has been developed with the support of
      * the Australian Research Council and the University of Melbourne
      * research grants as part of the Gridbus Project
      * within GRIDS Laboratory at the University of Melbourne, Australia.
      * Author : Akshay Luther (akshayl@csse.unimelb.edu.au), Rajkumar Buyya (raj@csse.unimelb.edu.au), and Krishna Nadiminti (kna@csse.unimelb.edu.au)
      * License : GPL
      * This program is free software; you can redistribute it and/or
      * modify it under the terms of the GNU General Public
      * License as published by the Free Software Foundation;
      * See the GNU General Public License
      * (http://www.gnu.org/copyleft/gpl.html) for more details.
      *
      */
      #endregion

      using System;
      using System.ComponentModel;
      using System.Reflection;
      using System.ServiceProcess;
      using System.Threading;
      using System.Windows.Forms;
      using Alchemi.Core;
      using Alchemi.Core.Manager;
      using Alchemi.Manager;
      using log4net;

      // Configure log4net using the .config file
      [assembly: log4net.Config.XmlConfigurator(Watch=true)]

      namespace Alchemi.ManagerService
      {
      public class ManagerMainForm : ManagerTemplateForm
      {
      public const string serviceName = "Alchemi Manager Service";

      	public ManagerMainForm():base()
      	{
      		InitializeComponent();
      		this.Text = "Alchemi Manager Service Controller";
      		Logger.LogHandler += new LogEventHandler(LogHandler);
      	}
      
      	#region Windows Form Designer generated code
      	/// /// Required method for Designer support - do not modify
      	/// the contents of this method with the code editor.
      	/// 
      	private void InitializeComponent()
      	{
      		this.components = new System.ComponentModel.Container(); **//Here is where it errors out at**
      		System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(ManagerMainFo
      
      B Offline
      B Offline
      BlaiseBraye
      wrote on last edited by
      #2

      there are two possibilities which mean the same... 1. you forgot to specify the protection level of the component field in your managertemplateform which means by default that it is set to private 2. you didn't forget it but specify it to private... Then if you want it to be not accessible by other class than children of the managertemplateform, you specify the protection level to protected... if you agree that any classes access to it, choose public.

      enjoy the code with you is my priority, Blaise Braye

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups