Click here to Skip to main content
15,913,773 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Business_Logic.class name() is inaccessible due to its protection level
Posted

Check the modifer and set is it to public if it is internal.

i.e.
C#
internal class someclass // -> set to public class someclass
{
    internal void name() // -> set to public void name() 
    {
    }
}
 
Share this answer
 
The method and the class which you are trying to call is private. Just Change it to public
 
Share this answer
 
v2
Comments
Kenneth Haugland 30-Jul-12 9:19am    
It was rediculus to vote you down for that, so I gave you a 4.
Hi,
Your business logic class is not public and you are trying to access it form presentation layer. You can access you classes of BL only when your class is public. Sample:
C#
public class TestClass
{
   // My class description
}



All the best
--Amit
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 30-Jul-12 19:31pm    
My 4, too. (Not 5, because it could work with "internal" as well, is used in the same assembly).
--SA
_Amy 30-Jul-12 23:35pm    
Thank you SA. :)
Yeah, I missed that.
The message is clear: you are trying to access a method that is not public (hence not accessible).
You are probably trying to access a piece of info that the class developer designed to be hidden, that is you are probably doing things the wrong way (or the class developer was not enough far-sighted).
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 30-Jul-12 19:29pm    
Or internal, for the same assembly... (voted 4 this time).
--SA
CPallini 31-Jul-12 3:12am    
Assembly?! :-D
Sergey Alexandrovich Kryukov 31-Jul-12 11:28am    
Yes, of course. "internal" works as "public" for the same assembly but does not allow access from a different assembly.
--SA
You need to set access modifier .... to public
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900