Navigation:  Getting started > Building the code from scratch >

Building and running the code

Previous pageReturn to chapter overviewNext page

Building the Code

1.In Visual Studio, go to Tools > Options > Projects and Solutions > Build and Run and check Only build startup projects and dependencies on Run. Express Edition users may need to check the Show all settings checkbox to see this page..

2.Open the solution file \Trunk\ImageViewer\ImageViewer.sln.
3.Build the solution.
4.Right click on the ClearCanvas.Desktop.Executable project and select Set as Startup Project .

Running the Viewer

There are a couple of ways to run the viewer:

1.Through Visual Studio:
Run the viewer like you would any other application built in Visual Studio (e.g. F5 to start debugging, Ctrl-F5 to start without debugging).
2.Through Windows Explorer:
Navigate to \Trunk\Desktop\Executable\bin\Debug (or Release) and run ClearCanvas.Desktop.Executable.exe.

Running the Viewer with the ShredHostService

If you want to receive or import images while running the viewer you will also need to run the ShredHostService. In the public distribution of  ClearCanvas Workstation, the ShredHostService is installed as a Windows service and is started on bootup, even when no one has logged in, so as to allow unattended receipt of images. During development, however, it is usually more convenient to run it just as a console app.  There are a couple of ways to do this:

1.Through Visual Studio:
Right click on the ImageViewer solution in the Solution Explorer and select Properties.
Click on Multiple startup projects.
Select the desired action for ClearCanvas.Desktop.Executable and ClearCanvas.Server.ShredHostServce.
Run as usual; both executables will run.

2.Through Visual Studio and Windows Explorer:
Start the viewer in the usual way through Visual Studio.
Start the ShredHostService by navigating to \Trunk\Server\ShredHostService\bin\Debug (or Release) and starting ClearCanvas.Server.ShredHostService.exe.
Express Edition users: if this option gives you problems, just run everything through Visual Studio.

Important note for Windows Vista users:  Because of Vista's more rigorous security checks, you need to run ShredHostService.exe with administrative privileges, otherwise it will fail to start properly.  If running through Visual Studio, be sure to Run as Administrator when starting Visual Studio.  If running directly, be sure to Run as Administrator when starting ShredHostService.exe.