How to: Setup AppFrame R3
This document is intended for system personnel and describes setup for the following:
- AppFrameR3 – Remoting Web Site
- AppFrameR3 – Services Web Site
- AppFrameR3 – R3CurrentBuild database
- AppFrameR3 – ClickOnce Deployment Site
- AppFrameR3 – ClickOnce as an MSI file for Deploying to Terminal Server
- AppFrameR3 – FileStore Server
- AppFrameR3 – AfMail Service
- AppFrameR3 - SQL Jobs
All Web Sites are set up without Windows Authentication. Best practice is to set up all sites without using Windows Authentication to be sure that everything works fine, then follow the procedure for Setting Up Windows Authentication for AppframeR3 Build 5 Environment
Prerequisites
- SQL Server 2005 / 2008 (Express* , Standard, Enterprise)
- Web Server with .NET FRAMEWORK 3.5 SP1
- FileStore Server (If FileStore will be on its own server)
- Visual Basic 2008 Full
- DevExpress controls *Please visit Sql Server Express limitations
AppFrameR3 – Remoting Web Site
Prerequisites
- Administrator access to Web Server
- DNS address to the Site(s)
- AppFrameR3 – Remoting Web Site files. (AppFrame Best Practice, Create a www folder under c:\ and the name of the Site under www, For Example c:\www\Remoting.pims.no\)
Setting up the Website in IIS
To set up website in IIS open IIS Manager and choose “Add Web Site...” from Sites’ context menu
Write in your Site name (Application Pool is automatic created with the Site Name, remember that all Application in your Site should use this Application Pool and NOT the Default Pool for IIS) and choose the folder for your website. Choose Binding Type, IP Address, Port and Host name
Setup AppFrame Remoting site as an Application inside another Web3/4 site.
Create a folder inside your Web3/4 site called Remoting. Then copy your remoting bin folder and web.config into it. Ensure that your web.config is configured right
Open IIS Manager and right click your newly created folder named Remoting and choose Convert to Application - Ensure that the Application Pool is the same as on your Web3/4 site then Click OK.
Open you Web3/4 web.config (Not the one in Remoting Folder), add this code under system.web tag
<location path="Remoting">
<system.web>
<authorization>
<allow users="*" />
</authorization>
</system.web>
</location>
This code will will grant access to the Remoting Folder when its inside an authenticated web3/4 site without authentication so CR3 can read the service list or use Remoting Access Layer. You should now be able to use your Web3/4 URL/Remoting as your remoting or service list site.
Test the Remoting Site
Go to you Browser. Fill in you site name + /afremotingloader.rem?wsdl . This is just to check that you are able to reach the site and can access it. If you get an Error: Cannot display the webpage. Verify that DNS Entry is created for the Site and the IP that you set on the site.
AppFrameR3 - Services Web Site
You can choose to either create a own Web Site as a Services site or include the Services.XML file to Remoting Site. In the package "Remoting-Site.zip" there is a Services.XML file, Follow the same steps as Creating Remoting Site if you would like to have a own Service Site or copy the file to the Remoting Site Folder.
Overview of Tags in Services.XML
- Name
- This the Unique name of the spesific Service. You will refer to this name in your Service DropDown list in CR3 Client and in you TeamDoc PIMS WebSite.
- MainProjectName
- Optional. You can specify the Main Project that will be started in you CR3 Client. The Default will be Sys.WinClient.Main
- Server
- Specify your SQL Server Name by FQDN name or IP Address or DNS Name
- Database
- Specify your SQL Database name
- WebUrl
- You can specify the TeamDoc PIMS URL so you can reach TeamDocuments from inside the CR3 Client. If you do not have any site, spesify http://
- IsR3Site
- Optional. True or False. If you have spesified WebUrl to be used in CR3 Client. True if its a Web3 Site and False if its a Web2 Site
- RemotingHost
- Specify your Remoting Site URL
- Responsible
- Optional. If you want to specify the Responsible for this Service.
- WebPublisherUrl:
- Specify your WebPublisher Url. (In this guide we have not setup a WebPublisher Site yet, so you will need to go back to the Services.xml and fill this in later. For now spesify only http://)
- Test Services.xml
- Go to your Browser. Fill in the sitename + /services.xml. You should then get the services.xml file in you browser.
Restore R3CurrentBuild
Either do a restore from your PC through SQL Management Studio or copy the R3CurrentBuild file to your server and do the restore there (it will take longer time to do a restore from your PC). The Default User for R3CurrentBuild is Username: R3CurrentBuild , recreate this user so its has a SQL Login on you SQL Server.
AppFrameR3 – ClickOnce
Prerequisites
- Administrator access to Web Server
- DNS address to the Site(s)
AppFrameR3 – ClickOnce files (AppFrame Best Practice, Create a www folder under c:\ and the name of the Site under www, For Example c:\www\ClickOnce.pims.no\ or in a folder under your TeamDoc PIMS Site, then you dont need a new DNS and Web Site for ClickOnce) - Omega.pfx, Please contact: JanCB@omega.no to
Setting up ClickOnce folder
Create a folder inside your Service or Remoting Site. Eq. http://my.service.site/MyCR3. Then you should create a Folder called MyCR3 inside the site's folder.
Creating / Publish CR3 Client
Go to CR3 Projects and Download Sys.WinClient.Login , this is the Source to ClickOnce Project.
Publish Settings in Sys.WinClient.Login
(Open My Project from Solution Explorer in Sys.WinClient.Login.)
Publisher Folder Location
Specify a local folder on you harddisk or the UNC path to the folder on Web Server(Eq. \\Server209\WebFolder\WebSite\MyCR3\). This is the files that should go into the ClickOnce folder on your WebServer or inside the ClickOnce in CR3 Assemblies if you are going to use Virtual ClickOnce and not from WebServer.
Installation Folder URL
This is the URL that your Users will fill in there Browser and Install the CR3 Client from. Eq. http://deploy.appframe.com/PIMS
Application Files...
Here you will see all files and the Publish Status on the file(s). By default Appframe3 dll(s) and some DevExpress has Publish Status : Include and Download Group: Required. All that have a Download Group set to a group name will be downloaded if the User try to open a form that needs this Dll. So include all DevExpress that are not there by default as References and create a Download group for them. This way the client do not grow in size but if a new Project is created inside CR3 with references to a DevExpress Assembly that are not in ClickOnce, it will be downloaded and you dont need to publish a new ClickOnce. Remember that AppFrame3.Win.Dll, AppFrame3.Reporting.Dll and AppFrame3.ReportingAR.Dll SHOULD not be in the list, they should be removed from the Visual Studio if seen.
Signinig the ClickOnce with Certificate
In the Tab Signing you will need to choose a Certificate obtained from the Technology Dep.
DevExpress Registration
The version of DevExpress that you have installed on your PC needs to be register with DevExpress, if not you will get the DevExpress splash screen popup every time you lauche your application. Contact the Technology Dep. for obtaining the register info
Services.XML
Best practise is to hardcode the hole Service inside the Setting Services. You can copy your service from the services.xml file into this setting. To Enable this feature you will need to modify the service loading code. Go to Function LoadServices() in LogOn.VB and read the comment about using Services Setting instead of Service URL. If you want to use an Service XML file as URL, use the ServiceListUrl and spesify your URL like https://service.domain.no/services.xml and do not modify Function LoadServices()
Check Database connection.
We have a new feature that can checks if the client have connection to the Database server, if not the Connect Through Web Server will be checked of automatic. You need to specify you FQDN or IP address in the Database setting on Settings tab.
UseWindowsAuthByDefault
As the name says, use this if your users will use Windows Auth, then they don't need to change from SQL to Windows the first time they logon.
SelectDefaultService
This is also for the first time the user logs on, if you write on of your Service name here it will search the XML for it and select it. So the user dont need to choose the first time.
Publish
There are two ways to Publish a ClickOnce Application for AppFrameR3. Either publish direct to the web server (Spesify a network path like \\server\c$\www\remoting.site.no\MyCR3) or Publish to a local folder on your hard drive and upload this files to the folder on your Web Server.
You should now see your ClickOnce site when opening ClickOnce Deployment in a browser. Try Install it and login using your service. You should also try with and without Connect via Web to see if your Remoting Site is working.
Throubleshooting
Remember to Install Omega.pfx Certificate on you PC and select this Certificate in the Tab Signing. Go through Updates and Options Button in Publish tab to set the right options for your ClickOnce Deployment Site.
AppFrameR3 - ClickOnce as an MSI file for Deploying to Terminal Service
1. Open up your Sys.WinClient.Login project.
2. Add a new Project to the Solution - Setup Project and Name it.
Add File(s) to Application Folder: Project Output - Primary output and Localized resources. All Dlls should also be inside the Application Folder (E.g Aspose, Active Reports etc.)
Add ShortCut to Desktop, Primary output from Application Folder.
Change Lauch Conditions. Righ Click the Setup Project - View - Lauch Conditions and change .NET Framwork to Version 2.0
Remember to set properties like name, company etc.
You should now be able to Build the MSI and Install on your PC. Tips: Do some heavy testing on it with a PC without DevExpress. So you do not need to send IT guys an MSI more than once. Please contact Technology if you experience problems creating an MSI.
AppFrameR3 - FileStore Server
Prerequisites
- Administrator access to FileStore Server or the Web Server if you have placed the FileStore folder there.
Create a Folder Called FileStore and a SubFolder called the name of your Service. This is;AppFrame Best Practise.
The user that will access the FileStore is the user that you have specify with& <identity impersonate="true" or as Application Pool ID on Remoting Site. (If the User was a Local Windows User on Remoting Site Server this user also need to be created with the same username and password on FileStore Server as a Local Windows User. ) This user need Read and Write access to the folder. You need to share this folder with the user.
You need to update the stbl_System_FilesLocations in your SQL Database. Insert or Update the records with your UNC path to the FileStore folder, If you are not using Distibuted File store, the LocationID field needs to be NULL. Set Share for example to: \\MyFileServer\FileStore\MyService
AppFameR3 - AfMail Service
Prerequisites
- Administrator access to Server. AfMailServices files
- FQDN or DNS Name to SMTP Server that AfSendMail will send mail through
Install AfSendMail Service
Create a Folder on c:\ called Appframe - SubFolder named Services. Copy the files you downloaded to this folder.
Launch the file <Install SendMailService.bat>
Fill in Username and Password. If the User is a Local Windows User you need to write in front of the username .\
For Example: .\AfService
Modify MailSettings.xml to your needs. Then try to Start the Service.
Test Sending Mail
You need a User with a MailBox. Open Command Prompt on the server that you Installed AfSendMail. Write Telnet localhost 1002 , you are now connected to the Service and can see live if there are Mail going though it or if the service give any error msg it will display here.
Execute this SSTP from SQL Management Studio
EXEC sstp_Mail_MessageSendImmediate @FromLogin = '', @ToEmail = '', @ToName = '', @Subject = '', @TextHTML = ''
AppFrameR3 - SQL Jobs
This jobs should be created as SQL Jobs in SQL Agent
Rebuild Indexes and Statistics
Create an Step with Command: EXEC sstp_Database_Maintenance_UpdateStatistics
Create a new Step with Command: EXEC sstp_Database_Maintenance_RebuildIndexes
Schedule this job to run every day at 05:00:00 or at the time that your database have minimum user activity.
We are more then happy to help you with setting up an AppFrame Environment, please contact Technology.