This example shows you how to import binary types from the .NET Global Assembly Cache (GAC) into a UModel C# project. The instructions are similar if you want to import binary types from a standalone .dll or .exe file. For a Java example, see Example: Importing Java .class Files.
To import binary files from the .NET Global Assembly Cache:
1.On the Project menu, click Import Binary Types.
2.Choose the target language of the UModel project (C#, VB.NET, Java). In this example, C# is selected, since we are importing a .NET GAC assembly.
3.If you would like to set a specific language version for the imported UModel project, select it from the adjacent text box. In this example, C# 7.3 is selected.
4.Optionally, select a .NET runtime version from the Runtime drop-down list.
If you select the option any (use disassembler), UModel will choose a reflection API that is most appropriate for the imported binary. This is the default option and typically yields the best results.
5.If you import binary types into a new project, select either Merge Code into Model or Overwrite Model according to Code. Otherwise, select Merge code into Model.
6.Optionally, to generate class diagrams and package diagrams from the imported binary types, select the Enable diagram generation check box. If you select this option, more diagram generation options are available in subsequent steps, see also Generating Class Diagrams and Generating Package Diagrams.
8.Click Add | Assembly from Global Cache (GAC).
9.Select an assembly from the dialog box. In this example, the "EventViewer" assembly is selected.
10.Select the types to be imported, and click Next.
•The text box Override of PATH variable... is applicable only to Java. Optionally, paste here any Java class paths that must be queried in addition to those read from the CLASSPATH environment variable (or click Add and browse for the required folders).
•The check box use 'reflection only' context... is applicable only when you import a C# or VB.NET binary. This is useful when importing a library (dll, etc) which has dependencies that cannot be resolved or loaded. Selecting this check box will also not execute any static initializer code, which might cause errors when importing.
11.Select the import options as applicable, see Import Binary Options.
12.If you enabled diagram generation in an earlier step, click Next and configure the options applicable to diagram generation. Otherwise, click Finish.
UModel performs the conversion, and displays a progress log in the Messages window. If conversion of binary types was not possible, the error text may provide additional information. For example, it might be the case that the binary file you attempted to import was targeting a runtime newer than the one selected on the "Import Binary Types" dialog box. In this case, try again and select a newer runtime version.