There are a few requirements that must be met in order to setup a custom IceLib-based application from within Visual Studio, regardless of the version of Visual Studio used.

  • Use .NET Framework 3.5 or greater. Client Profile versions of .NET Frameworks cannot be used due to IceLib dependencies.
  • Select the appropriate processor architecture (either x86 or x64).
  • Include the necessary IceLib binary references. Note that the unmanaged assembly dependencies required by IceLib do not get copied to the project's output folder when adding the reference, so they will have to be copied manually.

Step-by-step instructions on setting up a custom IceLib-based application in Visual Studio.

Note
Visual Studio 2010 is used in this example, but any version of Visual Studio that supports the .NET Framework 3.5 or greater can be used.

After starting Visual Studio, go to the "New Project" screen. Select ".NET Framework 3.5", or a later version of the .NET Framework. After selecting the appropriate project type (Windows Forms Application, Console Application, etc.), give the project an appropriate name. The "New Project" screen should resemble something similar to the following:

Visual Studio New Project

After clicking the "OK" button, the next step is to setup the required project-specific properties. To do this, right click the project node in the Solution Explorer, and select "Properties". If using Visual Studio 2010 or earlier (Visual Studio 2012 defaults to not use the Client Profile), it will be necessary to change the "Target framework" from the "Client Profile". On the "Application" tab, be sure that the "Target framework" has an appropriate framework version selected - any .NET Framework version 3.5 or greater will work, as long as it is not a "Client Profile". Changing this will require the solution to be reloaded, in which case the properties window will need to be re-opened:

Visual Studio Application Properties

After changing (or verifying) the "Target framework", the project's "Platform target" will need to be changed on the "Build" tab. By default, Visual Studio will select "Any CPU" for this; however, because of the unmanaged assemblies that IceLib has dependencies on, a specific target must be selected. If the IceLib references that this project will be using are the x86 binaries (which is the typical case), select "x86" for the "Platform target"; otherwise, if the x64 binaries will be used, select "x64" for the "Platform target":

Visual Studio Build Properties

Due to the fact that all dependent IceLib binaries must reside in the output folder of the project, it will be necessary to copy those binaries over. An easy way to accomplish this is with pre-build commands. On the "Build Events" tab, there is a section where these commands can be added:

Visual Studio Pre-Build Properties
An example pre-build command could be "xcopy "$(ProjectDir)..\..\bin\*" "$(TargetDir)" /i /d /y" (without the lead and end quotes). This command, which will run prior to the project building, assumes that the IceLib SDK installation is located 2 folders back from the project location - this will have to be modified to fit individual needs. It will copy all files from the "bin" folder into the project's output folder. It assumes that the destination is a folder and will create it if it doesn't already exist (/i argument), will only copy files that have not been changed (/d argument), and will suppress overwrite prompts (/y argument). The IceLib SDK's Example Applications use this method to handle copying the dependent binaries over.

After making the necessary changes, the next step is to add in the IceLib references to the project. In the Solution Explorer, right click on the "References" node in the project and select "Add Reference". Browse to the "bin" folder under the installation folder of the IceLib SDK and select the ININ.IceLib* binaries that will be needed in the project. Be sure that the added references are set to "Copy Local" in the "Properties" window:

Visual Studio IceLib Properties
Visual Studio should set "Copy Local" to true by default, but it should be verified that this behavior stays the same with the version of Visual Studio being used. If "Copy Local" is not set to true, then the referenced binary will not be copied to the output folder, and as stated previously, these binaries need to be located in the same folder that the custom IceLib-based application is, in order for it to function properly.