[This is prerelease documentation and is subject to change in future releases. Blank topics are included as placeholders.]
This is the third of seven tasks involved in creating a model-driven application using code name “Oslo” modeling technologies. For an overview of this tutorial, see Getting Started with the "Oslo" Tutorial.
In the previous step, you defined storage for model instances by adding extents to the SetupApplication model. For more information, see How to: Define Storage for "Oslo" Model Instances. The next step involves compiling and loading the Microsoft code name “M” model into the code name “Oslo” repository database. After the model and model instances are located in the database, applications can easily access the model to drive application behaviors.
To compile the setup model into an image file
From the Start Menu, click Run.
In the Run dialog, type cmd. Click the OK button to launch a command prompt.
Navigate to the directory where you previously saved the setup model in previous tasks.
Modify the PATH environment variable to include the path to the code name “Oslo” SDK tools. By default, the code name “Oslo” SDK tools install to <driveletter>:\Program Files\Microsoft Oslo SDK 1.0\Bin directory, where <driveletter> is the letter of the drive that contains the Program Files folder.
set PATH=%PATH%;"%PROGRAMFILES%\Microsoft Oslo\1.0\bin"
Use M.exe to create an image file that targets the “Oslo” repository database. The target parameter specifies Repository, which transforms the model into SQL Server using specific “Oslo” repository design patterns. The package parameter specifies Image. This creates an image file that the out parameter names SetupApplication.mx. An image file contains the necessary information to transform the model from “M” into a SQL Server data model. For more information, see Compiling "M" Files.
m.exe SetupApplication.m /target:Repository /package:Image /out:SetupApplication.mx /r:"%PROGRAMFILES%\Microsoft Oslo\1.0\bin\Repository.mx" /nowarn:3906
Tip: |
|---|
| Due to use of “Oslo” repository Folders in this model, the r parameter references the Repository.mx file that contains the necessary type definitions. Note that if you installed the “Oslo” SDK to a different path, you need to change this path to match your machine. |
Use the dir command to list the contents of the C:\SetupApplication directory, verifying the compilation of the SetupApplication.mx image file.
To load the setup model image into the “Oslo” repository database
-
In the open command prompt, use Mx.exe to load the image file into the “Oslo” repository database. This takes the information in the image file and creates a data model in the “Oslo” repository. This data model is a SQL Server representation of the “M” model defined in the SetupApplication.m source file.
mx.exe install SetupApplication.mx /database:Repository
Note: |
|---|
The command above uses integrated authentication to connect to the database, Repository, in the default SQL Server instance on the current machine. For more information about other options, see Loading Image Files into the "Oslo" Repository. |
In the next task, use SQL Server Management Studio to view the database representation of this SetupApplication model. For more information, see How to: View an "Oslo" Model Using SQL Server Management Studio.
See Also