Touch.TouchFilesClass is inaccessible due to its protection level 
Author Message
 Touch.TouchFilesClass is inaccessible due to its protection level

I am a beginner with C# and I am missing something. I have created a
simple library assembly containing a single class. I have added the
reference to the assembly to my project and I have added a using
directive for the namespace in the library.

When I try to compile the project I get the error,
"Touch.TouchFilesClass is inaccessible due to its protection level". I
cannot find "protection level" in the help. Can someone tell me what I
am missing and/or point me to a reference that will explain how to use
my library assembly in my project?

Thanks,

Bill
--
Bill



Thu, 02 Jun 2005 11:41:27 GMT  
 Touch.TouchFilesClass is inaccessible due to its protection level
Bill,

Quote:
> I am a beginner with C# and I am missing something. I have created a
> simple library assembly containing a single class. I have added the
> reference to the assembly to my project and I have added a using
> directive for the namespace in the library.

> When I try to compile the project I get the error,
> "Touch.TouchFilesClass is inaccessible due to its protection level". I
> cannot find "protection level" in the help. Can someone tell me what I
> am missing and/or point me to a reference that will explain how to use
> my library assembly in my project?

You probably have:

class TouchFilesClass
{

Quote:
}

And need to change it to:

public class TouchFilesClass
{

Quote:
}

Hope that helps.

Regards,

Randy



Thu, 02 Jun 2005 12:04:16 GMT  
 Touch.TouchFilesClass is inaccessible due to its protection level

Quote:
> > When I try to compile the project I get the error,
> > "Touch.TouchFilesClass is inaccessible due to its protection level". I
> > cannot find "protection level" in the help. Can someone tell me what I
> > am missing and/or point me to a reference that will explain how to use
> > my library assembly in my project?

> You probably have:

> class TouchFilesClass
> {

> }

> And need to change it to:

> public class TouchFilesClass
> {

> }

In my opinion it would be nice to have public or none at all
default access specifier in C#. It could avoid this silly bug.
--
Vladimir Nesterovsky



Fri, 03 Jun 2005 03:09:57 GMT  
 Touch.TouchFilesClass is inaccessible due to its protection level
I don't agree with that. If absence of protection level specification
implied public, something you intended to be private could end up public,
with easy way to test things.

Defaulting to private means that you soon discover that you've forgotten to
add the public qualifier. Basically, its the concept of "fail safe" -
something critics of Microsoft might accuse them of not doing enough.

--
Nick Holmes
Coyote Software, GmbH.


Quote:
> > > When I try to compile the project I get the error,
> > > "Touch.TouchFilesClass is inaccessible due to its protection level". I
> > > cannot find "protection level" in the help. Can someone tell me what I
> > > am missing and/or point me to a reference that will explain how to use
> > > my library assembly in my project?

> > You probably have:

> > class TouchFilesClass
> > {

> > }

> > And need to change it to:

> > public class TouchFilesClass
> > {

> > }

> In my opinion it would be nice to have public or none at all
> default access specifier in C#. It could avoid this silly bug.
> --
> Vladimir Nesterovsky




Fri, 03 Jun 2005 03:45:54 GMT  
 Touch.TouchFilesClass is inaccessible due to its protection level
Default is Internal, I beleive.
As already stated, change to Public.
Roger
Quote:
> When I try to compile the project I get the error,
> "Touch.TouchFilesClass is inaccessible due to its protection level". I
> cannot find "protection level" in the help. Can someone tell me what I
> am missing and/or point me to a reference that will explain how to use
> my library assembly in my project?

> Thanks,

> Bill
> --
> Bill



Fri, 03 Jun 2005 08:03:51 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. blah .... is inaccessible due to its protection level

2. OnEditCommand is inaccessible due to its protection level

3. Inaccessible due to its protection level

4. protection level

5. C sharp protection level?

6. Why am I getting a General protection Fault?

7. I am new to programming and am lost

8. Compile error C3376 - type is inaccessible

9. VS Watch and other debug windows inaccessible

10. inaccessible control text property

11. Inaccessible bits in integral types

12. typecast warning: inaccessible

 

 
Powered by phpBB® Forum Software