Up Configuration and deployment code samples
DevForce 2010 Resource Center » Code samples » Configuration and deployment code samples » Walk through: N-Tier configuration starter tool (Console) (WPF)

Walk through: N-Tier configuration starter tool (Console) (WPF)

Last modified on August 15, 2012 17:21

In this walk through we'll show you how to use a simple utility provided with the DevForce installation, the "N-Tier Configuration Starter".


  • Platform: Console, Desktop
  • Language: Any
  • Download: None. This is a walk through. 

Problem

If you've developed your desktop application in 2-tier mode, you may be confused how to deploy it n-tier.

Solution

The Deployment N-Tier Configuration Starter Tool is a simple utility which can help get you started.  You can use this utility to have DevForce create separate Client and Server folders containing the necessary files for an n-tier deployment using the ServerConsole.  

Launch the N-Tier Configuration Starter Tool

  1. Launch the N-Tier Configuration Starter Tool from the Windows Start Menu.  You can find the N-Tier Configuration Starter Tool on the Windows Start Menu at All Programs / DevForce 2010 / Tools / N-Tier Configuration Starter.

You’ll see a dialog like the following:

DeploymentTesterStart.png

  1. Click the ellipsis <...> button next to the Source Path and browse to the folder holding your solution. (This is the folder for the startup project for your solution; here we used the QueryExplorer from the code samples.) The N-Tier Configuration Starter Tool will populate itself out with lots of information:

DeploymentTester.png

The data grid on the lower half of the dialog is of some interest: it shows you exactly what files will be deployed to the Client and Server parts of your application.

  1. Click the <Deploy> button. When it completes (very quickly) you should see the message “Files Deployed” in the status bar at the bottom of the dialog. Open a Windows Explorer window and navigate to the bin\debug folder under your startup project. You’ll find two folders there created by the utility: Client and Server.  

The contents of the Client folder might be as follows (here we used the QueryExplorer sample from the code samples as our startup project):

ClientFiles.png

The Client gets the main application executable, its config file, the entity model assemblies, and other assemblies referenced by the application. (The TraceViewer.exe is shown here because the applciation referenced it.)  The <objectServer section in the config file is also updated to point to the server. (The utility does not currently modify the <connectionStrings>, but this information is not needed on the client.)

The contents of the Server folder contain the following (again for the QueryExplorer application):

ServerFiles.png

The Server also gets the entity model assemblies, and assemblies to which references are set, but it also gets several files not deployed to the Client. These include the ServerConsole.exe and the ServerConsole.exe.config.

  1. Now click the <View / Launch> button. You’ll see another dialog like the following:

launchwindow.JPG

This dialog defaults to a selection of the ServerConsole. Just click the <Launch Exe> button to launch it. (Alternatively, you could just double-click the ServerConsole.exe application in the Server folder.) You’ll probably need to tell Windows that it’s okay to let the application through the firewall by clicking <Unblock> in response to the security alert:

WindowsAlert.JPG

As you can see, the ServerConsole is a console application.  The window is held open, and the EntityServer kept active, until the window is closed. You can press ENTER in the command window to shutdown the ServerConsole, but don’t do that just yet.

You now have an n-tier EntityServer running, hosted by the ServerConsole.

  1. Now return to the File Launcher and change the setting in the Client/Server comboBox at the top to “Client”:

output_html_m66afc937.png

Using the <Launch Exe> button again, launch your executable.  (If you were following along with the QueryExplorer you can launch both the TraceViewer.exe and then the SampleQueries.exe.)

  1. Your application is now running in n-tier, albeit all on one machine.  Your client application will now communicate with the EntityServer hosted by the ServerConsole to login and retrieve and save data.  If you launched a TraceViewer, it will show a log of all server activity.

Prerequisites

The tool should only be used with Windows or console client applications which are not already configured with a web project to host the EntityServer. If you used the DevForce templates for an n-tier application then you do not need to use this tool. It also cannot be used with a Silverlight application.

Created by DevForce on July 14, 2010 15:40

This wiki is licensed under a Creative Commons 2.0 license. XWiki Enterprise 3.2 - Documentation. Copyright © 2015 IdeaBlade