You are on page 1of 13

Setting up Code Charge to publish

to Princetons dotNET environment


Ahead of time
You will need to have requested an account on Princetons dotNET development
environment. If you have not already done so, you may request an account at
http://weblamp.princeton.edu/dotnetform. As part of your dotNET account setup you
will be required to create two subdirectories, dotnet and dotnet-dev, under the
directory designated for this project in your departmental folder on the Central File
Server.
Mount the folder containing the above directories on your computer. The dotnet
folder will be where your production applications reside; the dotnet-dev folder will
be for your test or development environment. You should also create a data folder
for your Access database(s) at the same level as dotnet and dotnet-dev. You will
need to change the permissions of these folders to give full read/write access to the
service netID that was given to you in your dotNET account setup instructions.

Each application that you plan to create in your dotNET environment should live in a
separate, uniquely-named folder inside the dotnet and dotnet-dev folders. We

recommend that you do NOT include any blanks in this folder name. This folder
name will also become part of the URL of your application:
https://[yourhostname] -dev.princeton.edu/[folder name]/
https://[yourhostname].princeton.edu/[folder name]/

Before deploying code to the newly created application folder, you will need to tell
the dotNET administrators to register this application/folder with IIS by sending a
request to oitdas@princeton.edu . Be sure to include the full path to the application
subdirectory in your request. Your application will not work until you do this.

Creating Your First Code Charge Studio Project


1. Launch Code Charge Studio
2. Select New Project from the Dialog Window, and click OK
3. On the next Window, provide a name for your project, and a location for
where the local files will be stored on your computer. You also need to select
a scripting language for your project to use. Since we are publishing to
Princetons dotNET environment, you have two choices -- ASP .NET VB (Visual
Basic) or ASP .NET C# -- and the option of including some built-in features
bundled as the InMotion Framework. If you have a preference between VB
and C#, you can make it here. If you do not plan to do custom scripting, then
either choice is valid. When you have made these choices, click OK.
4. Code Charge has now generated your new .NET project, and created a default
page called NewPage1, which should be open in your editor.

5. To configure the project for publishing to Princetons dotNET environment,


select: Project -> Settings.

Select Server/Script from the left-hand menu. Create IIS Application is set
to true by default. Change this to false.

6. Still within the Project -> Settings window, select Publishing from the lefthand menu. We need to tell Code Charge where to publish your application
to. The current Active Server (at the top of the window is a default, called
Server 1. Click the button to the right of this, Edit Servers. Click
Rename for the default (Local) server, and rename it something to indicate
that it is publishing to the Development server (such as
[ApplicationName]Dev).

Click Okay to return to the Publishing Options. For the Server Path, enter
the path to your new application folder within the dotnet-dev folder on the
Central File Server. For example: \\files\dept\[department]\[netID]\dotnetdev\[folder name]. For the Server URL, enter the dotnet-dev URL for your
application: https://[yourhostname]-dev.princeton.edu/[folder name]/

7. If you are going to use CAS for Princeton authentication, or plan to use any
other DLLs, select the radio button next to All files excluding extensions for
the Files to Publish.

8. You may go through steps 6 and 7 again to set up a second, production


server that publishes to the dotnet folder to be served by the dotNET
production machine. To create a new server, click the Edit Server button,
then click the New button, and provide a name for the new server. After
clicking Okay, you will return to the main Publishing page, where you can
select the new server from the pulldown list of servers. Provide the File
Server Path to your dotnet production folder, and the URL to the production
machine.
9. Before finalizing the changes, make sure that the correct (prod or dev) server
is set to active. This is done by clicking the Edit Servers button. You will
see (active) after the currently active server. To change the active server,
select the server you wish to be active, and then click the Set active
button.
10.When the Publishing information is complete, click Okay.
11.To test your settings, put the cursor in the page editor for the default page
(currently called NewPage1). Type Hello World! and then Save (File ->
Save). Publish this new project (Project -> Publish Project). Below the page
editor you should see status messages. If there were no problems, you will
see the message Publish Project - 0 critical error(s), 0 error(s), 0 warning(s).

Open a web browser and go to the URL of your project, specifying the page
NewPage1.aspx. You should see your Hello World! message. Your
CodeCharge project is now set up.

Connecting to an Access Database on the Central File


Server.
This will give instructions for connecting to an Access database from an existing
Code Charge project. It is assumed, but not required, that the Access database
resides in the same folder on the Central File Server as the dotnet and dotnetdev folders.
1. Open your Code Charge project. Select Project -> Settings, and from the left
menu, click Connections. Click Add.

2. Provide a descriptive name for this Database Connection, and then select
MS Access from the pull-down of supported database types.

3. Leave Use Connection String selected, and click on the Build button.
4. From the list of MS Access DB OLE providers, select Microsoft Jet 4.0 OLE DB
Provider and click Next.

5. Provide the path to your Access Database on the Central File Server, for
example: \\Files\Dept\[department]\[netID]\data\MyDatabase.mdb

6.

If you have a certain username and password that you want your web
application to use, enter it here.
7. Click Test Connection to confirm that Code Charge can connect properly to
your database.
8. Click Okay to save the current Connection String.
9. Click Okay to save the current Connection Information.
10.Highlight your new Connection, and click Test to confirm that it is working.

11.Click Okay to return to your Code Charge project. You are now set to build
web pages that interface with your Access database.

You might also like