Ice Visual Studio Extension
Visual Studio is one of the most popular development environments for Windows. The Ice Visual Studio Extension provides seamless integration of Ice application development with the Visual Studio IDE, making it a breeze to create and modify Visual Studio projects for Ice applications.
The extension provides the following features:
- Handles all aspects of translating Slice files
- Incrementally recompiles Slice files after modifications
- Maintains dependencies among Slice files
- Highlights compilation errors in Slice source code
- Automatically removes obsolete generated source files
- Supports C++, .NET, and Silverlight projects
- Simplifies the inclusion of Ice libraries and assemblies
The Ice Visual Studio Extension is available for Visual Studio 2008. (The extension is not available for Visual Studio Express.)
Installation
The Ice Visual Studio Extension is included in the Windows installer for Ice, which you can find on the download page. The installer automatically configures Visual Studio to enable the extension.
Using the Extension
Activating the Plug-in for a Project
After installing the plug-in, right-click on the project in the Solution Explorer and choose Ice Configuration... or select Ice Configuration... in the Tools menu. This opens a dialog that allows you to configure the project settings for Ice.
Note that, after adding new configurations or platforms to your project, it may be necessary to disable and then re-enable the plug-in for the new configuration or platform to get the correct Ice settings.
Configuring Project Settings
- Ice Home: The directory where Ice is installed.
- Slice Compiler Options: Tick the corresponding check boxes to pass --tie (.NET only), --ice, --checksum, or --stream options to the Slice compiler. Tick Console Output if you want Slice compiler output to appear in the Output window.
- Extra Compiler Options: Enter extra Slice compiler options not supported by Slice Compiler Options. These options are entered the same as they would be on the command line. For example, you can define preprocessor macros by entering -DFoo -DBAR.
- Slice Include Path: The list of directories to search for included Slice files (-I option). The checkbox for each path controls whether the path is passed to the -I option as an absolute path or as a path relative to the project directory.
- DLL Export Symbol (C++ only): The symbol to use for DLL exports (--dll-export option).
- Ice Components: The list of Ice libraries to link with.
Environment Variables
The Ice Home, Extra Compiler Options, and Slice Include Path settings allow environment variables to be specified. To do this, the environment variable must be entered using $(VAR) as the format. For example, for Ice Home you could use $(ICE_HOME).
Adding Slice Files to a Project
Use Add -> New Item... and select Slice File (.ice) as the template to create and add a Slice file to a project. To add an existing Slice file to a project, use Add -> Existing Item...
Generating code
The extension compiles a Slice file whenever you save the file. The extension tracks dependencies among Slice files in the project and recompiles only those files that require it after a change.
Generated files are automatically added to the project. For example, for Demo.ice, the extension for C++ adds Demo.cpp and Demo.h to the project, whereas the extension for C# adds Demo.cs to the project.
Slice compilation errors are displayed in the Visual Studio Output and Error List panels.
Source Code
The source code for the extension is included in the Ice source code distribution available on the download page. Refer to vsplugin/INSTALL.txt for build and installation instructions.