IForeRuntime.ResolveAssembly

Syntax

ResolveAssembly(AssemblyName: String): IForeAssemblyBinary;

ResolveAssembly(AssemblyName: String): Prognoz.Platform.Interop.Fore.IForeAssemblyBinary;

Parameters

AssemblyName. Assembly which presence is to be checked.

Description

The ResolveAssembly method checks whether the specified assembly is in the repository.

Comments

If assembly exists, the method returns its metadata. For further work with assembly and its constructions, use the IForeRuntime.BindToAssembly method.

Example

Executing the example requires that repository contains an assembly with the ASSM_TEST identifier.

Add a link to the Fore, Metabase system assembly.

Sub UserProc;
Var
    ForeService: IForeServices;
    Runtime: IForeRuntime;
    AssmBin: IForeAssemblyBinary;
Begin
    ForeService := MetabaseClass.Active 
As IForeServices;
    Runtime := ForeService.GetRuntime;
    
//Obtained assembly metadata
    AssmBin := Runtime.ResolveAssembly("ASSM_TEST");
    //View assembly metadata
    Debug.WriteLine("System assembly: " + AssmBin.Builtin.ToString);
    Debug.WriteLine(
"Loaded: " + AssmBin.IsLoaded.ToString);
    Debug.WriteLine(
"Assembly name: " + AssmBin.Name);
    Debug.WriteLine(
"Namespace: " + AssmBin.Namespace_);
    Debug.WriteLine(
"Source object/file: " + AssmBin.ObjectName);
    Debug.WriteLine(
"Links to other assemblies: " + AssmBin.References);
    Debug.WriteLine(
"Date and time of the last launch: " + AssmBin.TimeStamp.ToString);
    Debug.WriteLine(
"Version: " + AssmBin.Version.ToString);
End Sub UserProc;

Imports Prognoz.Platform.Interop.Fore;
Imports Prognoz.Platform.Interop.Metabase;

Public Shared Sub Main(Params: StartParams);
Var
    ForeService: IForeServices;
    Runtime: IForeRuntime;
    AssmBin: IForeAssemblyBinary;
Begin
    ForeService := Params.Metabase 
As IForeServices;
    Runtime := ForeService.GetRuntime();
    
//Obtained assembly metadata
    AssmBin := Runtime.ResolveAssembly("ASSM_TEST");
    //View assembly metadata
    System.Diagnostics.Debug.WriteLine("System assembly: " + AssmBin.Builtin.ToString());
    System.Diagnostics.Debug.WriteLine(
"Loaded: " + AssmBin.IsLoaded.ToString());
    System.Diagnostics.Debug.WriteLine(
"Assembly name: " + AssmBin.Name);
    System.Diagnostics.Debug.WriteLine(
"Namespace: " + AssmBin.@Namespace);
    System.Diagnostics.Debug.WriteLine(
"Source object/file: " + AssmBin.ObjectName);
    System.Diagnostics.Debug.WriteLine(
"Links to other assemblies: " + AssmBin.References);
    System.Diagnostics.Debug.WriteLine(
"Data and time of the last launch: " + AssmBin.TimeStamp.ToString());
    System.Diagnostics.Debug.WriteLine(
"Version: " + AssmBin.Version.ToString());
End Sub;

On executing the example, the repository assembly with the specified identifier will be loaded to the execution environment. Assembly metadata will be displayed to the development environment console.

See also:

IForeRuntime