Things to know about Milestones Professional and ASP

Things to know about using Milestones Professional from Server-side ASP scripts under IIS on Windows Servers:
   
1 On your IIS Server, make sure that you are running the latest version of Milestones Professional.
2 On your IIS Server, make sure that Milestones Professional is installed on your server with a valid Serial Number and Program Key for All Users. Using the Trial Version from ASP scripts will be difficult due to the dialog boxes that appear when saving files and printing. An All Users install is important because the IIS user that the IIS service uses is a different user than the one used for installing the software.
3 On your IIS Server, make sure that Milestones is properly registered to handle the Milestones file type that you will be using. For example Milestones Professional 2012 uses .mle files. You should be able to double-click on a Milestones file and cause Milestones to start and open the file. If not, then from inside Milestones go to Tools | Program Options | Files and Automation and Press the ReReg button. This program will ensure that Milestones Professional is registered as the handler for all current Milestones files, e.g. .MLA, .MLB, .MLD, .MLE, etc. files. This is important when making a GetObject call from a script - GetObject depends upon file types being correctly associated with the proper application. When ReReg it runs you will get an elevation prompt. For it to run successfully you must give it Admin rights
4 On your IIS Server, set Milestones to run a new instance for each invocation from Automation. This is done by checking the "Run as Multiple Instances for COM/Automation" checkbox in the Tools | Program Options | Files and Automation menu, General tab. This needs to done to prevent one automation session from interfering with another. Since Milestones is a Multiple Document Interface (MDI) application, by default just one instance will attempt to serve all automation interfaces. There can be problems with this when running on a server since any one automation session could cause a problem or delay that would affect all sessions. There is no reason to attempt to run Milestones Professional as a service and it is not recommended that you do so.
5 Remember that any JPEG or PNG files that Milestones creates that you intend to view via an HTML img command must be accessible from your web site. Our examples show that when you pass the .jpg filename to Milestones you use the actual path/filename of the folder/file on your server (which should be a folder accessible to your web site) and when you refer to this .jpg file from your HTML img command you use the http://... designation for the same file. Be sure that the IUSR_computer_name or IIS_IUSRS ID has whatever access is required to the folder you use to hold any files that are saved from the script.
6 Be aware that during your testing you may be leaving "dangling" miles.exe processes running on your server. You should terminate these using a process viewer tool such as Process Explorer (http://technet.microsoft.com/en-us/sysinternals/ or http://technet.microsoft.com/en-us/sysinternals/bb896653). TaskMgr also works, just be sure to view processes from all users.     
7 If you are using Windows Server 2003 R2 or Windows Server 2008, or Windows Server 2012 (which have more restrictive default security) you may need to enter the Component Services screen (Start | Programs | Administrative Tools | Component Services | My Computer | DCOM Config | Milestones Professional Schedule | Properties. In the Properties box under Launch and Activation, select Customize, and add the local machines Internet Guest Account, which is usually "IUSR_computer_name" or IIS_IUSRS and give it Local Launch and Local Activation privileges.
8 Under IIS Web Service Extensions make sure the Active Server Pages is set to Allowed. The default setting is usually Prohibited. On Windows Server 2008 or 2012 make sure that ASP and/or ASP.NET is enabled for whatever web site you will be using.
 
Things to know about using Milestones Professional from Server-side ASP.NET scripts under IIS on Windows Servers. (Thanks very much to Deepa Swamy of DDEi for figuring this out.)
   
1 Enter the Component Services screen (Start | Programs | Administrative Tools | Component Services | My Computer | DCOM Config | Milestones Professional Schedule | Properties. In the Properties box under Launch and Activation, select Customize, and add the local machines Internet Guest Account ( "IUSR_computer_name" or IIS_IUSRS)and Network Service account; and give them Local Launch and Local Activation privileges.
2 Double check that in the Web Server (Start | Run | Type inetmgr) under Web Server Extensions, ASP.NET is allowed, by default it is prohibited.
3 Add <identity impersonate="true"> under <system.web> section in the applications's Web.Config file and restart IIS. (http://msdn2.microsoft.com/en-us/library/aa302377.aspx).
4 From inside Milestones go to Tools | Program Options | Files and Automation and Press the ReReg button. This program will ensure that Milestones Professional is registered as the handler for all current Milestones files, e.g. .MLA, .MLB, .MLD, .MLE, etc. files.
5 Give Read/Write permissions to IUSR_computer_name or IIS_IUSRS account, to the folders where the image (gantt chart) file will be stored.
6 Run Process Monitor to check for any 'ACCESS DENIED' errors and fix them by giving the necessary permissions. ( http://technet.microsoft.com/en-us/sysinternals/bb896645 ).
7 If problems still exist after all the above steps, then try creating a VBS script to create the Milestones object and execute it locally as an administrator to see if it's working.

ASP Code Examples

Click here to visit our main programmer's page.