How to setup development ENV for MIUS
Please refer to the Readme.md file in Azure DevOps Repo for MIUS for the most recent information
https://dev.azure.com/transport-canada/DSD-MARINE%20Support/_git/MIUS?path=%2FREADME.md&_a=preview
Introduction Marine Insurance Unit System (MIUS)
MIUS was originally developed to facilitate the production of CLC and Bunker certificates. MIUS is a VB.NET windows forms application deployed using click once features. The current version of the application is targeted .NET framework 4.0.
Current Production Release is 1.4.5
Support is assigned to Team Kraken
Current Development Project MIUS Project Phase 1: Wreck Certificate and Service Standards (Product Vision Board )
Getting Started
The MIUS project requires the following
Visual Studio 2015 with update 3 (\\tc4s0b\groups\afccb\Team Kraken\MIUS\en_visual_studio_enterprise_2015_with_update_3_x86_x64_web_installer_8922986.exe). You can choose the default install do not need any advanced tools as Visual Studio 2015 should only be required for some legacy projects.
Crystal Reports Developer version for VS, use version CRforVS_13_0_18.exe in folder \\tc4s0b\groups\afccb\Team Kraken\MIUS\Crystal Reports Developer version for VS.
- Select the option to install the 64-bit run time
This file must be installed after visual Studio to properly set up the ClickOnce prerequisites packages for Crystal Reports, the VS 2015 packages can be found here C:\Program Files (x86)\Microsoft Visual Studio 14.0\SDK\Bootstrapper\Packages. Install the SDK and the run time as of March 2019 this version of Crystal is compatible with the version of crystal installed on workstations.
When your development environment is setup clone the repository from Azure DevOps and open the MIUS.sln file
The configuration file with the database access connection strings are not checked into DevOps. A copy of the file can found at \\tc4s0b\groups\afccb\Team Kraken\MIUS\secureconfig. Copy the secureconfig folder and place it as a subdirectory of the MIUS solution.
Set up Clickonce and Signing
The application uses a Clickonce deployment and in order to build\publish the correct certificates will need to be installed on your workstation.
- Install the \\tc4s0b\groups\afccb\Team Kraken\MIUS\Marine Safety Root CA.cer into the Trusted Root Certification Authorities
- Install the \\tc4s0b\groups\afccb\Team Kraken\MIUS\MSID.PFX into your personal certificates
- Validate the Marine Safety MSID personal certificate is OK by opening and making sure no errors are found. You will not be able to publish the application if the certificates are not installed properly.
- Open the solution, it has already been setup to be signed with the certificate above, however if you need to remove or change open the project properties and go to the Signing section, here you can turn off Signing or select the certificate from the Store.
- Publish Settings are used to set the application files for deployment and the ClickOnce package prerequisites.
- There are several prerequisites that Crystal seems to want (i.e. MDAC 2.8, Framework 2.0) but that are not installed as part of visual studio, you can ignore these in the prerequisites and any warnings during the uild\publish as the application will install and run on TC workstations.
Database Connection String
- The app.config file points to an external connectionstring configuration file to load the connections and passwords. For security purposes this file is excluded from any commits and must be set up by the developers (See the projects .gitignore).
Using Visual Studio create a new folder named secureconfig
Create a new config file named connections.config and update with the connection strings, See The configuration file found at \\tc4s0b\groups\afccb\Team Kraken\MIUS\secureconfig or open the RDIMS document # 13232403 - MSS Application and Database details.xls file and copy the MIUS application connections strings from the Configuration connection String sheet to the connectionstrings section.
<connectionStrings> <!-- Put secure connection strings here do not commit to repo--> </connectionStrings>
Any files placed into this folder will not be committed into the repository blocked by gitignore.
NOTE:
DO NOT add any sensitive data to the code or application configuration files.
DO NOT add any files which may contain sensitive data.
Windows Forms Designer Issue
A few of the forms, frmCertificateBUNKER and frmCertificateCLC, do not open in properly in the IDE, and they report a runtime error when opened. This is due to a behaviour where the designers need to run some code when opened even in the IDE, in this case it tries to connect to the database and reads the connection string from the config file. In the IDE the system is not able to read from the App.cofing but instead is reading from the Visual studio DevEnv.exe.config. So as a workaround we need to update this config with the Debug_MIUSdb connection string section. For Visual Studio 2015 this file is found at C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\devenv.exe.config. Open the file and add a valid connectiontring section with the Debug_MIUSdb add entry. Once this change is done you should be able to open these forms.
NOTE: Modification to the devenv.exe.config file requires Administrator rights
Crystal Reports Runtime Deployment Product.xml
<a name="crystal"></a>
(C:\Program Files (x86)\Microsoft Visual Studio 14.0\SDK\Bootstrapper\Packages\Crystal Reports for .NET Framework 4.0)
On TC desktops the standard Crystal Reports Runtime version is the 32-bit version 13.0.6, although MIUS is using the 13.0.18 SDK the run time files for Crystal are compatible with the build. However, as Crystal Reports is pre-installed we do not want it to be updated by the MIUS click-once deployment, so the Bootstrapper package product.xml file needs to be updated.
**In 32-Bit section of Product.xml
Changed This:
<!-- ByPass if the installed version is same or higher -->
<BypassIf Property="CRRuntime32Version" Compare="VersionGreaterThanOrEqualTo" Value="13.0.18"/>
To This (commented out 13.0.18 and added in check for 13.0.6 ) :
<!-- ByPass if the installed version is same or higher -->
<!--<BypassIf Property="CRRuntime32Version" Compare="VersionGreaterThanOrEqualTo" Value="13.0.18"/> -->
<BypassIf Property="CRRuntime32Version" Compare="VersionGreaterThanOrEqualTo" Value="13.0.6"/>
**In 64-bit section of Product.xml
Commented out the install for 64-bt crystal section as below:
<!-- ByPass if the Processor is not x64 -->
<!--
<BypassIf Property="ProcessorArchitecture" Compare="ValueNotEqualTo" Value="AMD64"/>
-->
Removed comments around the Bypass to not install 64 bit:
<!-- Uncomment the below BypassIf entry if you do not want to install the 64bit version CRRuntime redist in the target machine -->
<BypassIf Property="ProcessorArchitecture" Compare="ValueEqualTo" Value="AMD64"/>
Note
Also copied over the msi files for click-once into the bootstrap folder, not sure if needed some say they are but I dont see them being included. \\tc4s0b\groups\AFCCB\Team Kraken\MIUS\Crystal Reports Developer version for VS\clickonce Runtime\CR 13.0.18