473,387 Members | 1,530 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Inconsistent Accessibility

I get this message "Inconsistent accessibility: return type
'TimeTracker.TrackerObjects.Project' is less accessible than method
'TimeTracker.TrackerObjects.GetProject(int)'"

Here's the code
namespace TimeTracker
{
public class TrackerObjects
{
private static Project aProject=null;

public static Project GetProject(int projID)
{
if(aProject==null)
{
aProject = new Project("1", "NET CF Book",
DateTime.Today.AddDays(-100),
DateTime.Today.AddDays(100), 3, "Finish NET CF Book");
}
return aProject;
}

private class Project
{
public string sProjNo;
public string sProjName;
public DateTime dtProjStart;
public DateTime dtProjEnd;
public int iProjTasks;
private ArrayList taskList;
public string sProjComments;

public Project(string sProjNo, string sProjName, DateTime
dtProjStart,
DateTime dtProjEnd, int iProjTasks, string sProjComments)
{
this.sProjNo = sProjNo; this.sProjName = sProjName;
this.dtProjStart = dtProjStart; this.dtProjEnd = dtProjEnd;
this.iProjTasks = iProjTasks; this.sProjComments =sProjComments;
this.taskList = new ArrayList(iProjTasks);

}
public bool Add(Task aTask)
{
try
{
taskList.Add(aTask);
return true;
}
catch
{
return false;
}
}
}
public struct Task
{
private string sTaskID;
private string sTaskName;
public DateTime dtTaskStart;
public DateTime dtTaskEnd;
public int iTaskEstimate; //in hrs
public int iTaskActual; //in hrs
public string sTaskComments;
public Task(string sTaskID, string sTaskName, DateTime dtTaskStart,
DateTime dtTaskEnd, int iTaskEstimate, int iTaskActual, string
sTaskComments)
{
this.sTaskID = sTaskID; this.sTaskName = sTaskName;
this.dtTaskStart = dtTaskStart;
this.dtTaskEnd = dtTaskEnd; this.iTaskEstimate = iTaskEstimate;
this.iTaskActual=iTaskActual;
this.sTaskComments = sTaskComments;
}
}
}
}
thanks
Sunit
Nov 16 '05 #1
1 67980

"Sunit Joshi" <sj****@ingr.com> wrote in message
news:8f**************************@posting.google.c om...
I get this message "Inconsistent accessibility: return type
'TimeTracker.TrackerObjects.Project' is less accessible than method
'TimeTracker.TrackerObjects.GetProject(int)'"

Here's the code
namespace TimeTracker
{
public class TrackerObjects
{
private static Project aProject=null;

public static Project GetProject(int projID)
{
if(aProject==null)
{
aProject = new Project("1", "NET CF Book",
DateTime.Today.AddDays(-100),
DateTime.Today.AddDays(100), 3, "Finish NET CF Book");
}
return aProject;
}

private class Project
{


You can't return a private class from a public method. A public methods
return type has to be public so that the users that call it can use the
return type.
Nov 16 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: hodari | last post by:
My program compiles correctly in VS 2003 but fails in VS2005 Express Edition - I get a compile error Inconsistent accessibility: return type 'VA.Customer' is less accessible than method...
4
by: waltborders | last post by:
Hi, Because the blind are unable to use a mouse, keyboard navigation is key. A major difficulty is that not all windows forms controls are keyboard 'tab-able' or 'arrow-able' or have "tab...
5
by: Andy Fish | last post by:
Consider the following code fragment public class Wrapper { protected enum E { IN, OUT }; public class C { protected void foo(E e) { } } } I want the class C to be accessible from outside...
3
by: AAV | last post by:
what is wrong with the code i get 'Error 1 Inconsistent accessibility: parameter type 'ConsoleApplication1.Garage.CarDelegate' is less accessible than method...
0
by: mariano774 | last post by:
Hello, I'm building a POC architecture framework, in which I have my business objects (BOs) made of internal classes and my transfer objects (TOs) made of public classes. what I'd like to do is...
3
by: WillyL | last post by:
I keep getting the following error message: Inconsistent accessibility: return type 'System.Collections.Generic.IEnumerable<Iteraties.Aandeel>' is less accessible than method...
1
by: bachyen | last post by:
I have the following code, but it is error when I build it. Can you help me? Can you tell me more about 'Inconsistent accessibility: return type', 'Inconsistent accessibility: parameter type'. ...
3
by: EvilProject | last post by:
While working on a scripting engine I Encountered the following problem. First I Created an abstract base class EPType that represent a variable type in the script. internal abstract class...
9
by: dylan.miller | last post by:
I'm having trouble understanding the internal access modifier. There are many classes in my assembly that should not be accessible outside of the assembly. I've used the internal access modifier...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.