Instructions to Add Web.config Manually

This topic provides the basic instructions on how to add the Web.config file to your WebSite projects. This topic covers the configuration settings as needed ONLY for ASNA Monarch.

When migrating a GamePlan and IIS is not installed, you will receive the message shown below in your Log Panel. When this occurs you will need to manually add the Web.config file to your solution.

 PM Writing Web.Config
6:33:28 PM Failed to write Web.Config: IIS is not installed; Cocoon is not able to generate
Web.Config file automatically. Please refer to Help on how to add it manually.
6:33:30 PM ** End Task ** Migrating GamePlan

Add the Web.config File

Start the Debugger

Start the application debugger by selecting Debugger --> Start Debugging from the toolbar menu or pressing F5. Visual Studio will notice that there is not a Web.config associated with the web site and will ask if you want to add a default file. Respond "yes".

Use ASP.NET Configuration Manager

Select "ASP.NET Configuration" from the Website drop-down menu to add the Web.config file. (If Website does not appear on the toolbar, select any file or node in the "Web" section in the solution explorer window.) More detail can be found within Visual Studio while using this tool.

Use standardized Web.config file

Your systems administrator may want to ensure standardized settings to support Monarch as well as other settings that may be unique to your web environment that are not addressed here. Creating a standard Web.config file for ASNA Monarch applications would support standards and eliminate the necessity of creating this file from scratch for each application.

If a standard Web.config is used, you still need to add this file to your solution. Select "Add Existing Item" from the solution explorer menu, browse to the location of your standard Web.config and select the file.

Add ASNA Monarch References:

You will need to add references for the ASNA Monarch assemblies. Select "Add Reference" from the solution explorer window.

Select .NET Components

The Select Component dialog will display. From the .NET tab, Add the three ASNA components highlighted in the image below, then select OK. This will update the <assemblies> section of the Web.config file.

Update Application Settings

If the AppSettings.Config file is used to establish function key settings, the <appSettings> section of the Web.config file needs to be updated as follows:

<appSettings file="AppSettings.Config" >

If Message files are used in the website, then the location of these files must be established as the value for the MonarchMessageFileFolder key in appSettings.

<add key="MonarchMessageFileFolder" value="C:\Monarch\MsgFiles\" />

Note: The value for "MonarchMessageFileFolder" allows the use of the symbol "~", as in value="~\Monarch\MsgFiles\" to specify the website "root" and make this a relative reference instead of an absolute path location.

Add Monarch File Overrides

If you use file overrides on the job level, you'll need to update the <MonarchFileOverrides>. During execution of the application, these entries will direct Monarch Framework to locate the aspx in the given folder.

<MonarchFileOverrides>
	<add key="LOGONDF" value="ToFile=./pages/Logondf.aspx"/>
</MonarchFileOverrides>

Save the Web.config File

Save all files in the solution and then close and re-open the solution to activate the settings.

Web.config File Sample

A partial sample of a Web.config file is provided below with the red text shown as it pertains to this topic. Note in the <assemblies> section that the Version and PublicKeyToken values will vary depending on your installed versions of those three assemblies.

Using WebRoot

This special folder is provided as a method to allow any files and sub-folders it contains to be copied directly into the web root of your Visual Studio solutions. This folder may contain master pages, images, cascading style sheets, site map pages.

The WebRoot folder is set up similarly to templates in that you create a new WebRoot folder paralleling the originally installed WebRoot folder and also set the Agent's templates root path in the migration directive to your templates location.

However, there is one major exception. The installed WebRoot folder and your new WebRoot folder are mutually exclusive. If there is a WebRoot folder in the Agent's templates root path, the entire contents are copied to the web root of your solution; otherwise, the WebRoot installation folder contents are copied. The contents are NOT combined.

If you want to use WebRoot:

  • Optionally, copy the entire contents of the installed WebRoot folder to the Agent's templates root path location if you want to use any of the installed files.
  • Add any additional files.
  • Make any changes to any existing templates and/or master pages files you may have copied from those installed.
  • Set the Agent's templates root path in the migration directive to the location of the templates as previously noted above.

Example:

The following figure shows the MyTemplates\WebRoot folder to be copied into the web root of the Visual Studio solution provided Agent's templates root path is set to C:\MyTemplates.

Next: Web Server Controls Overview

Previous: Web.config Considerations