Share via


Setting Up Your Project

[This topic is pre-release documentation and is subject to change in future releases. Blank topics are included as placeholders.]

To work through this section of the Tutorial, you'll need to set up a project in Visual Studio 2005. Follow the instructions in this topic to set up your project.

Creating the Visual Studio 2005 Project

To create a custom tab and Settings page, you'll need to create a .dll file. In Visual Studio 2005, you can accomplish this by creating a Class Library project.

To create a class library project in Visual Studio

  1. With Visual Studio open, click File, point to New, and then click Project.

  2. In New Project, in Project Types, expand the node for the language you are using, in this instance Visual C#.

  3. Under Templates, click Class Library.

  4. For the purposes of this walkthrough, name your project MyWHSApp.

  5. Confirm Name, Location, and Solution Name, and then click OK to close the New Project dialog and to create your new Class Library project.

Configuring the Class Library Project

In order for your code to build correctly, you'll need to make sure you add the appropriate references, and you'll need to add the appropriate using statements (if you are writing your custom tab in Visual C#).

In this case, you'll need to copy HomeServerExt.dll to your computer, and then add a reference to HomeServerExt.dll, the file that you use to extend the Windows Home Server Console.

To add a reference to HomeServerExt.dll

  1. Copy HomeServerExt.dll from the %systemdrive%\Program Files\Windows Home Server\ directory on the server to a folder on your development computer, for example, "c:\HomeServerSDK." Alternatively, you can copy HomeServerExt.dll from the installation DVD for Windows Home Server (d:\WHS\SDK\HomeServerExt.dll, where d:\ is the letter of your DVD drive).

  2. In the Visual Studio Solution Explorer view, expand your project if it is not already expanded.

  3. Right-click References and then click Add Reference.

  4. On the Add Reference dialog, click the Browse tab, and then navigate to the location where you copied HomeServerExt.dll.

  5. Repeat steps 1 - 3 for the System.Drawing, and System.Windows.Forms namespaces with the exception that these references are on the .NET tab.

  6. HomeServerExt, System.Drawing, and System.Windows.Forms appear in References in Solution Explorer. Additionally, in the Visual Studio Object Browser window, a HomeServerExt node appears.

  7. For the purposes of this walkthrough, rename the code file for your class to HomeServerTabExtender.cs. To do so, right-click Class1.cs in Solution Explorer. Click Rename on the popup menu. Rename the file to HomeServerTabExtender.cs.

  8. When the message appears asking if you want to rename all references to this class in your project, click Yes.

Also, if you are writing your code in Visual C#, make sure to add using statements to your code:

To add "using" directives for your custom tab

  1. In the Visual Studio Solution Explorer, double-click HomeServerTabExtender.cs.

  2. Navigate to the top of the file where the using statements are located.

  3. Add the following using directives:

    1. using System.Drawing;
    2. using System.Windows.Forms;
    3. using Microsoft.HomeServer.Extensibility;

In the next topic, Creating a New Tab, you will need to use a bitmap to complete the walkthrough.

Important

The bitmap must have dimensions no greater than 32 x 32 pixels. A bitmap that is greater than this size will be resized or cropped.

Your custom .dll file must be named as follows: HomeServerConsoleTab.YourCustomArea.dll. The first part of the file name, HomeServerConsoleTab cannot be changed. YourCustomArea represents the theme or purpose of your custom tab and can be any name you choose. For example, the Shared Folders tab in the Windows Home Server Console is implemented in the .dll file, HomeServerConsoleTab.Sharing.dll.

To make sure that your .dll has the name that you want at build time, set the name in the project properties.

To change the .dll name at build time

  1. With your Class Library project open, right-click the name of your Class Library project in Solution Explorer and then click Properties.

  2. In the tab for your Class Library project properties, click Application.

  3. In Assembly Name, type **HomeServerConsoleTab.**YourCustomArea, where YourCustomArea represents the theme or purpose of your custom tab and can be any name you choose.

  4. When you build your custom .dll, it will have the correct naming convention of HomeServerConsoleTab.YourCustomArea.dll.

See Also

Concepts

Extending the Windows Home Server Console
Creating a New Tab
Creating a Settings Tab
Changing Tab Order
Deploying Your Console Tab