c# - public variable not accessible -
in 1 namespace (ventosa.graphics) have public class named model
namespace ventosa.graphics { public class model : graphicsresource { public model(...) { ... } ... } }
then in project try access class
model player = new model(...);
but line creates error. c# recognizes model exists, claims isn't accessible due it's protection level. shouldn't making public mean it's accessible everywhere?
and yes, base class graphicsresource public.
this happens in few other places in project too, classes derived.
edit: exact error message (in german): der zugriff auf "ventosa.graphics.model" ist aufgrund der sicherheitsebene nicht möglich. translated english, says: "ventosa.graphics.model" inaccessible due protection level.
you describe should not be. i'd suggest try reproduce problem in simplest way possible. won't able to. add sample, making more , more production code, until trigger problem.
remove reference superclass graphicresource
. make sure there's 1 constructor defined. try instantiate class same namespace, using full namespace references (not using
statements) , single, explicit constructor. it'll work.
if doesn't work, step bit , define new type entirely (ventosa.graphics.modeltest
or something). make sure that works.
now, add pieces in. inherit graphicresource
, try that. remove namespace qualifications; use using
instead. move instantiation different namespace, different assembly.
you've verified definition of graphicresource
class public. of its superclasses?
Comments
Post a Comment