ASP.NET has a feature that allows you to declare implicitly used namespaces in the web.config file.
<configuration> <system.web> <pages> <namespaces> <add namespace="System.Web.Mvc"/> </namespaces> </pages> </system.web> </configuration>
I am curious to see if this configuration is available for other .net environments (e.g. winforms, console applications, and in particular Silverlight applications). If so , then the next question is whether we can have a namespace alias in the specified configuration.
An analog of this bit of code, but through the configuration:
using MyNamespace = System.Web.Mvc;
edit: my intention comes from viewing projects like silversprite , whose goal is to provide an identical XNA API for silverlight. This allows you to write an XNA game once and then deploy it online using silverlight. The only problem is that the whole version of the silversprite APIs is in a different namespace, so to use it you need to use ifdef around using statements. It would be great if it were just a silversprite namespace alias so that your code shouldn't change between platforms.
Joel martinez
source share