This tutorial shows how to configure and run the .NET Framework Demo Service.
| Overview | |
|---|---|
| Summary | This tutorial covers how to run the .NET Framework Demo Service for Web Applications. |
| Completion Time | 10 minutes |
| Platform | .NET Framework Application |
| IDE | Visual Studio 2019, 2022 |
| Development License | Download LEADTOOLS |
Be sure to download and install the LEADTOOLS SDK, and make sure the license and key files are located in the <INSTALL_DIR>\LEADTOOLS22\Support\Common\License directory. To set the license, refer to the Add References and Set a License tutorial.
The installed LEADTOOLS SDK contains the LEADTOOLS Demo Service projects. The .NET Framework and .NET Core Demo Service projects offer the ability to communicate to a server to make .NET calls when running an HTML5/JS application. The Demo Service projects are set up to run alongside many of our HTML5/JS Demos out of the box (i.e. ViewerDemo).
Open DemoServices.csproj or DemoServices_Nuget.csproj.
Opening the project from the <INSTALL_DIR>\LEADTOOLS22\Examples\Main\JS\DemoServices\fx folder is ready to run immediately. Doing so will launch the Demo Service on the following url and port: http://localhost:20300.
If the Demo Service application has been moved outside of the above directory, then specify the file path to the LEADTOOLS v22 license <INSTALL_DIR>\LEADTOOLS22\Support\Common\License. To specify the file path open the appsettings.json file in the DemoServices\fx folder.
On line 42 find the "lt.License.FilePath" and enter the in the license file path.
"lt.License.FilePath": "C:\path\LEADTOOLS.lic"` On line 48 find the "lt.License.DeveloperKey" and enter the file path for the developer key.
"lt.License.DeveloperKey": "C:\path\LEADTOOLS.lic.key"
By default the Demo Service will run on http://localhost:20300. To change the port the service is running on, open the launchSettings.json file in the DemoServices\fx\Properties folder. Four lines need to be changed in order for the service to run on a different port. Find "applicationUrl" on lines 6 and 20, and find "launchUrl" on line 14. Then change their corresponding values to the desired url and port number. The launchSettings.json should look as follows:
{"iisSettings": {"windowsAuthentication": false,"anonymousAuthentication": true,"iisExpress": {"applicationUrl": "http://localhost:20300/","sslPort": 0}},"profiles": {"DemoServices": {"commandName": "Project","launchBrowser": true,"launchUrl": "http://localhost:20300/index.html","environmentVariables": {"ASPNETCORE_preventHostingStartup": "False","ASPNETCORE_ENVIRONMENT": "Development"},"applicationUrl": "http://localhost:20300/"}}}
Once the license is set and the settings are configured, build and run the project.

This tutorial showed how to configure and run the .NET Framework Demo Service.