CSCI-E237, Fall 2010
Homework Assignment 0
To be completed BEFORE the first class

Simple .NET Client and Component

This is supposed to be a relatively easy homework assignment, to give you a simple introduction to the .NET mindset, get your development environment set up properly, and get your brain warmed up for this class. If you are seriously tested by it, run, don't walk, to the registrar and drop this class.

You need not submit this assignment, and it will not count for a grade even if you do. It is intended as a warm-up only. Point values for the individual items are show for demonstration only.

1. You will submit this and all other homeworks in one Visual Studio 2010 solution containing multiple projects. The name of the solution will be E237[yourfirstinitialandlastname]HW[assignment number], for example E237DPLATTHW0. The name of the projects in the solution will be given in the project instructions. Any questions that you are asked to answer as part of a homework assignment (this assignment contains none, but future assignments will) must be in a file labeled "readme.txt", included as part of the specified project.

2. In your solution, create a project called "PoliceDispatcherClient". Make it contain a Windows Form client containing the user interface shown below. Place your name and the assignment number in the title bar so the TA can see whose work he is grading.  Neither the combo boxes nor the text boxes need to contain anything particular just yet. (30 pts)

3. Create another project called "SecureCommunicationComponent". Make it contain a class called Communicator, in a file with the same name as the class. Make this class support a single method called "SendAlert", which accepts a string parameter called Addressee, another string parameter called "Message", and returns a string. For now, make the component return the "Message" string parameter that it has been passed, with the characters "Received:" and the assembly version number (as a string) prepended to it. Do not hard wire the version number, instead, fetch it from the component's metadata. Do not supply any assembly data other than the version number. Hint: See the documentation for the class System.Reflection.Assembly. (30 pts)

4. When the user runs the client and clicks the "Call" button, create an instance of this component and call SendAlert, using the contents of textBox3 as the Addressee, passing any string you care to as the message. For now, display the response in a message box. (10 pts)

5. Generate a strong name signing key file  using the command line utility sn.exe as described in your readings, or using Visual Studio's internal tools. Use this key to sign the component assembly you created in step 3. Submit your key file with your homework. Use the same one throughout this class. (10 pts)

6. Submit two batch files that use the command line utility Gacutil.exe (the presence of which in the command path you may depend on) to place your component into and remove it from the target machine GAC. Make it run from your solution's root directory and target the location of the debug executable.  If you have trouble, read the command line utility's instructions and examples (gacutil /?) VERY carefully. (10 pts)

7. Build your client against version 1.0.0.0 of the component. Then change the version of the component to 1.1.0.0 without rebuilding the client. Create and submit a configuration file that redirects the client's request for the version 1.0.0.0 (the version that it was linked against) to version 1.1.0.0 (the version it actually now has). Hint: Read the development environment documentation about the "app.config" file.  (10 pts)