I am having an issue trying to figure out how to appropriately name my namespace. My namespace is currently:
<CompanyName>.<ProductName>.Configuration
However, using "Configuration" conflicts with:
System.Configuration
To make matters worse, I also have a class called ConfigurationManager. I know I could change it to something like:
<CompanyName>.<ProductName>.<ProductName>Configuration
but that seems redundant. Any ideas?
EDIT: Also, I'm aware when calling either class I can fully qualify the calling code but the frequency that the classes in the System.Configuration
namespace and <CompanyName>.<ProductName>.Configuration
namespace will be used would make for ugly code.
EDIT2: Providing specifics:
Using statements:
using System.Configuration;
using SummitConfiguration = SST.Summit.Configuration;
Problem Line Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.PerUserRoamingAndLocal);
Error Message 'SST.Summit.Configuration' is a 'namespace' but it is used like a 'type' (for problem line above)
Typically, in cases like this, I leave the Configuration namespace, and use an alias for accessing my namespace (instead of fully qualifying). For example:
using System.Configuration;
using PC = MyCompany.MyProduct.Configuration;
// ...
string configValue = PC.ConfigurationManager.GetValue("Foo");
What about doing something like this:
using System.Configuration;
using MyCompany.MyProduct.ProdConfig
or
using System.Configuration;
using MyCompany.MyProduct.Config
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With