crazyboybert
Programmer
Hi all
I'm not sure this is possible but I thought it was worth asking. Is there a way to make a constant (in this case a string) available throughout a class library without it existing in a class or struct and therefore needing to instantiate an object to access it?
What I would like to do is have a global constant (like a key in web.config or an Application level variable in ASP.NET) that I can access throughout my class library. If I just declare a const variable directly in the namespace a build error is thrown as only class, delegate, interface, struct and enum are allowed directly within a namespace.
Rob
Go placidly amidst the noise and haste, and remember what peace there may be in silence - Erhmann 1927
I'm not sure this is possible but I thought it was worth asking. Is there a way to make a constant (in this case a string) available throughout a class library without it existing in a class or struct and therefore needing to instantiate an object to access it?
What I would like to do is have a global constant (like a key in web.config or an Application level variable in ASP.NET) that I can access throughout my class library. If I just declare a const variable directly in the namespace a build error is thrown as only class, delegate, interface, struct and enum are allowed directly within a namespace.
Rob
Go placidly amidst the noise and haste, and remember what peace there may be in silence - Erhmann 1927