C# Класс VSEmbed.VsLoader

Sets up assembly redirection to load Visual Studio assemblies.
This class must be initialized before anything else is JITted.
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
FindAllVersions ( ) : IEnumerable

Finds all installed Visual Studio versions.

Load ( System.Version vsVersion ) : void

Initializes the assembly loader with the specified version of Visual Studio.

LoadLatest ( ) : void

Initializes the assembly loader with the latest installed version of Visual Studio.

Приватные методы

Метод Описание
CurrentDomain_AssemblyResolve_Roslyn ( object sender, ResolveEventArgs args ) : Assembly
CurrentDomain_AssemblyResolve_VS ( object sender, ResolveEventArgs args ) : Assembly
GetInstallationDirectory ( System.Version version ) : string

Gets the installation directory for the specified version.

GetSkuVersions ( string sku ) : IEnumerable
LoadResourceDll ( AssemblyName name, string baseDirectory, CultureInfo culture ) : Assembly
TryLoadInteropAssembly ( string installDirectory ) : bool

The interop assembly isn't included in the GAC and it doesn't offer any MEF components (it's just a simple COM interop library). Hence it needs to be loaded a bit specially. Just find the assembly on disk and hook into the resolve event. Copied from @JaredPar's EditorUtils.

Описание методов

FindAllVersions() публичный статический Метод

Finds all installed Visual Studio versions.
public static FindAllVersions ( ) : IEnumerable
Результат IEnumerable

Load() публичный статический Метод

Initializes the assembly loader with the specified version of Visual Studio.
public static Load ( System.Version vsVersion ) : void
vsVersion System.Version
Результат void

LoadLatest() публичный статический Метод

Initializes the assembly loader with the latest installed version of Visual Studio.
public static LoadLatest ( ) : void
Результат void