Skip to content
22 changes: 22 additions & 0 deletions docs/csharp/language-reference/keywords/extern-alias.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,28 @@ You might have to reference two versions of assemblies that have the same fully-

In the previous example, `GridV1::Grid` would be the grid control from `grid.dll`, and `GridV2::Grid` would be the grid control from `grid20.dll`.

## Using Visual Studio

If you are using Visual Studio, aliases can be provided in similar way.

Add reference of *grid.dll* and *grid20.dll* to your project in Visual Studio. Open a property tab and change the Aliases from global to GridV1 and GridV2 respectively.

Use these aliases the same way above

```csharp
extern alias GridV1;

extern alias GridV2;
```

Now you can create alias for a namespace or a type by *using alias directive*. For more information, see [using directive](using-directive.md).

```csharp
using Class1V1 = GridV1::Namespace.Class1;

using Class1V2 = GridV2::Namespace.Class1;
```

## C# Language Specification
[!INCLUDE[CSharplangspec](~/includes/csharplangspec-md.md)]

Expand Down