[This is prerelease documentation and is subject to change in future releases. Blank topics are included as placeholders.]
The common language runtime (CLR) domain (the System_Runtime Schema in SQL Server) contains extents, types, and constraints that taken together represent .NET Framework metadata that can be used for many development and software management scenarios. The code name “Oslo” modeling technologies SDK also contains a tool, LoadAssembly.exe, that can extract metadata from .NET Framework assemblies and insert that metadata into the System_Runtime domain models in the code name “Oslo” repository. Once there, .NET Framework metadata can be queried and manipulated to provide information across an entire enterprise.
Overview and Walkthrough
The CLR domain contains models that represent .NET Framework assembly metadata, such as assembly and type information. The models are useful for, among other things:
- Browsing or searching for managed information.
- Analyzing metadata for dependencies and the impact of modifications.
- Using in conjunction with other models to represent specialized behavior or categories of information.
- Future data mining.
Browsing and Searching .NET Framework Metadata
Development managers, architects, and developers frequently need to examine managed metadata to do their daily work, using Visual Studio or other tools to examine assemblies and display structural information, such as inheritance trees or embedded resources, to find the data that enables them to do their work efficiently and well. Each additional assembly added to current reflection engines, however, tends to reduce the response time of the tools, which in turn reduces the immediate usefulness of information. In an environment with hundreds or thousands of managed components, obtaining metadata information in a useful fashion becomes difficult.
Using the LoadAssembly.exe Command Line Reference tool, you can reflect over very large numbers of assemblies and load that assembly and type information into the code name “Oslo” repository System_Runtime Schema domain models, enabling developers and development managers to examine huge amounts of metadata across a project, division, or enterprise and extract valuable information quickly and easily. In addition, because the code name “Oslo” repository is a SQL Server 2008 database, you can use your favorite tool or language to obtain the information you want. For example, it might be useful to discover how many public types are exposed in a particular subset of components or across an entire enterprise.
Building Custom Model-Driven Applications
Data Mining
Analytics
System_Runtime Walkthrough
The following three procedures demonstrate how to use the System_Runtime domain.
Loading .NET Assembly Metadata into the “Oslo” Repository
To load assemblies into the repository using the command prompt
At the command prompt, navigate to a directory in which there is a .NET Framework managed assembly. For example, you can use your default code name “Oslo” modeling technologies SDK installation directory of C:\Program Files\Microsoft Oslo\1.0\bin\.
Now import assembly metadata into the repository, following these steps:
- Type the following command:
loadassembly m.exe -foldername:”MCompiler” –d:Repository
Note: |
|---|
| Because Loadassembly.exe also loads the metadata from assemblies that are referenced by the target assembly, using an assembly like M.exe can take some time. |
Browsing .NET Framework Metadata in “Quadrant”
To browse the System_Runtime domain
Open Microsoft code name “Quadrant”.
Click View, then Explorer, then Repository.
Expand the Catalog and expand System_Runtime. Locate and then drag the Assemblies extent into a new workpad.
The Assemblies extent opens in its configured Tree Master/Detail view, and you should see many items in the list.
Click any of these and see the metadata in the right-hand pane. Note that you cannot edit the metadata.
To browse inserted .NET Framework metadata
Choose an assembly, and expand further to show the Modules. Then expand further to show the Types.
Select a type, and then locate and expand the list of methods that belong to that type.
Expand Namespace and see that the namespace for each type is listed.
Querying .NET Metadata
To find all public types
In SQL Server Management Studio, paste in the following query:
use Repository
select Types.Name
from System_Runtime.Assemblies inner join
System_Runtime.Modules on Assemblies.Id = Modules.Assembly inner join
System_Runtime.Types on Modules.Id = Types.Module
where Types.Access = 6 and
Assemblies.Id = 1
See Also