|
Exercise - setting up projects in Visual Studio
.NET
- make yourself a new directory (folder) and enter it
- right click and save this Java application source file into
your new directory: HelloWorldApp.java
- VS .NET organizes files into solutions and projects
- a solution can hold one or more projects
- a solution will use a subdirectory to hold projects
- a project contains the files necessary to generate a single
program
- each project will use a subdirectory to hold files
- start VS .NET
- create a new empty solution
- choose File>>New>>Blank Solution
- give the solution a name, for example, jett
- click browse and specify your directory
- you will now have a new subdirectory, jett, that has two
solution files in it
- create a new project
- choose File>>Add Project>>New Project
- click on Visual J# Projects
- scroll down and click on Empty Project
- give the project a name, for example, Hello
- click OK
- you now have a subdirectory jett\Hello that contains some
project files
- bring in an existing file
- choose File>>Add Existing Item
- browse to where you saved HelloWorldApp.java and select
it
- you will see that it has been added under the Hello project
- if you look in the subdirectory, you will see it has been
copied there
- compile the Hello project
- choose Build>>Build Hello
- execute the Hello project
- choose Debug>>Start without Debugging
- create another new project
- choose File>>Add Project>>New Project
- click on Visual J# Projects
- scroll down and click on Empty Project
- give the project the name Purse
- click OK
- you now have a subdirectory jett\Purse that contains some
project files
- bring in an existing file
- right click and save Purse.java
in the jett\Purse directory
- right click and save ConsoleInputTest.java
too
- choose File>>Add Existing Item and add both of these
files
- you should see that they have been added under the Purse
project
- choosing a project to compile
- click on Hello in the Solution Explorer
- choose Build, note that Build Hello is in the menu
- click on Purse in the Solution Explorer
- choose Build, note that Build Purse is in the menu
- compile the Purse project
- click on the Purse project
- choose Build>>Build Purse
- execute the Purse project
- right click on the Purse project
- choose Set As StartUp Project
- note that it is now in bold, and Hello is not in bold
- choose Debug>>Start without Debugging
- you can set up as many projects as you like in the solution
|