tags:

views:

78

answers:

3

There is Aliases feature in C# that allows to work with different assemblies, containing equally named entities (classes, structures, enums). It is activated when you choose an assembly an referenced assemblies list. But I can't see any similar in VB.NET project. Is there such a feature in VB.NET? If no, why?

+2  A: 
Imports Data = System.Data

Will allow you to use:

Data.SqlClient

Similar to what you've seen in C#. Here is a blog post that discusses the usage. Here is an older one that laments another feature C# has that VB.NET doesn't (didn't?)

Jed Smith
RE the older blog post: VB.Net has had `Using` for ages. http://msdn.microsoft.com/en-us/library/htd05whh(VS.80).aspx
MarkJ
+2  A: 

I think you are talking about the /reference:alias=filename option accepted by the C# compiler. That allows you to rename the root namespace of the assembly. Very handy when you need to reference both an old and a new version of an assembly that otherwise contain classes with the same namespace and class names. Without that option, you'd always get an ambiguous identifier compile error. The namespace alias feature can't fix that.

No, VB.NET doesn't have that. Why? Ask at connect.microsoft.com.

Hans Passant