0

I am using System.Configuration.ConfigurationManager only once in my entire code, and I'm wondering if it is better practice to name it explicitly rather than use a 'using' declaration.

string LogoUrl = System.Configuration.ConfigurationManager.AppSettings["LogoURL"];

and

using System.Configuration;;
string LogoUrl = ConfigurationManager.AppSettings["LogoURL"];

Does having the 'using' declaration involve more overhead than explicitly stating the namespace e.g. does it pull in more than I need?

1 Answer 1

3

No, it doesn't.

The compiler converts all calls to a class to use the fully qualified name You can see it in the produced IL, using any decompiler.

Sign up to request clarification or add additional context in comments.

1 Comment

Ah so it is just a convenience for us developers. Thanks.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.