diff --git a/docs/csharp/language-reference/keywords/extern-alias.md b/docs/csharp/language-reference/keywords/extern-alias.md index ae1d0527807e8..30907d0282abf 100644 --- a/docs/csharp/language-reference/keywords/extern-alias.md +++ b/docs/csharp/language-reference/keywords/extern-alias.md @@ -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)]