NOTE: If you download this code as zip. You might need to unblock the files. To do that you can right click on a file (for example frmAbout.resX) and select unblock or you can open a
powershell
command line, go to folder where you downloaded these files and executeGet-ChildItem . | Unblock-File
NOTE: this demo uses SQLite. You might need to install the SQLite ODBC Driver
VBUC is a Mobilize.net product capable of VB6 to VB.NET or WinForms migrations. For more information about this product click here.
To migrate SKS follow the next steps
Start the VBUC desktop app and click the new project icon.
Next, choose a proper project name and set the source directory where the VB6 project file SKS.vbp
is located. Then, set the output directory for your migration.
Sometimes there might be some unresolved references that the VBUC can not resolve by itself, so they have to be set manually by right clicking it and selecting the option Set Reference Manually
.
If you are having a hard time looking for unresolved references, take a look a our TLB Github Repo. The reference you are looking for might be there.
Choose and confirm the upgrade options for your project. For SKS demo use default options.
Before starting the upgrade, choose the target ASP.NET
framework version and choose how you want to include our code helpers in the migrated app, for SKS demo use .NET framework 4.7
and Binary Helpers Integration
option.
Next, start the migration by clicking Upgrade Projects
and wait for the process to end.
After the process ends, open your migrated solution and compile your app.
Finally, move the file Orders.db
in the SKS_VB6 directory to the bin
directory in the migration output directory. Also, create an App.config
in the migrated solution and add the following to it.
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<section name="AdoFactories" type="UpgradeHelpers.DB.AdoFactoriesConfigurationSection, UpgradeHelpers.DB.Essentials" allowExeDefinition="MachineToApplication" allowLocation="true" />
<section name="AdoIdentityColumns" type="UpgradeHelpers.DB.AdoIdentityColumnsConfigurationSection, UpgradeHelpers.DB.Essentials" allowExeDefinition="MachineToApplication" allowLocation="true" />
</configSections>
<connectionStrings>
</connectionStrings>
<AdoFactories>
<!--
The following section declares some of the most common factories. It can be modified in order to accomplish your needs.
The factory declaration with the "isdefault" attribute set to true will be used by the upgraded application as the current provider factory.
The database type attribute can take one of the following values
* SQLServer: when the application interacts wiht Ms SQL Server
* Oracle: when the application interacts wiht Oracle
* Access: when the application interacts wiht Ms Access
* Undefined: when none of the previous is being used
-->
<Factories>
<add name="SQLServer" factorytype="System.Data.SqlClient" isdefault="false" databasetype="SQLServer" />
<!-- MS SQL Server -->
<add name="Oracle" factorytype="System.Data.OracleClient" isdefault="false" databasetype="Oracle" />
<!-- Oracle -->
<add name="Oledb" factorytype="System.Data.OleDb" isdefault="false" databasetype="Access" />
<!-- Any database through Oledb -->
<add name="Access" factorytype="System.Data.Odbc" isdefault="true" databasetype="Access" />
<!-- Any database through ODBC -->
</Factories>
</AdoFactories>
<AdoIdentityColumns>
</AdoIdentityColumns>
</configuration>
This will set the default database driver that the SKS WinForms application will use in run time.
Run the new WinForms version of SKS.
WebMAP is a Mobilize.net product capable of migrating WinForms apps to .NET core and Angular. For more information about this product click here.
- Contact Mobilize.net to request a WebMAP license required in the migration process.
- Download and install node.js.
- Run the command
npm install yarn
to install yarn. - Install Angular by running the command
npm install -g @angular/cli
.
These steps are required to migrate and install dependencies in your migrated web app.
Run WebMAP convertion tool using the following command.
./Mobilize.WFNetMAP.ConversionTool.exe -i <YourWinFormsSolutionFile.sln> -o <output directory> -l <License Path> --UseProductionNugets
First, add the new dependencies registry by running the following command.
npm config set registry https://www.myget.org/F/mobilizewebmap/auth/559d63b6-5f30-45eb-8acb-d5f7cb2858bc/npm/
After the registry was added, install Angular dependencies, go to the sks-angular
folder located inside the migrated app directory and run the following command.
yarn
This will automatically install all the required dependencies needed for the project. After the installation is finished, run the following command to build the Angular application.
ng build --prod
Before compiling and running the app, copy the files Orders.db
and App.config
to the migrated app root directory. After doing that just run your fresh new SKS web app.