What
Sub container for the ‘APP-X11-Forward-Development-Template-Stack’ development stack. Containing a project template for .NET Core 8.x in combination with GTK 3.24.24
For more information about setting up this stack and/or this sub-container , visit the main documentation page. You can find other Docker Template Stack (DTS) containers here.
*Is this a local repository project? If so, use this local link to access the main page file.
Quick setup .NET Gtk sub container
If you have previously installed this (or a similar) AFX foreward sub container, you can use these ‘quick setup steps’. Otherwise please first read the main documentation page.
- Create the WSLs (if not yet done)
In case you don’t have the WSL container, open CMD in the folder: ‘APP-X11-Forward-Development-Template-Stack\Base-Container\Afx-Base-Service' and execute:
wsl --import Ubuntu-docker-App-X11-Win32Dev ./wsl2-distro "install.tar.gz"
Remark:
By default the WSL image is created in the sub folder of the current directory (./wsl2-distro) you may choose to store this image more central, for example like in ‘d:\wsl-data\afx-stacks’, this way you can reuse this WSL distribution for different AFX stacks
- Create the base container (if not yet done)
Create docker base container (in folder: ‘Afx-Base-Service’)
docker-compose -f compose_app_forward_x11_base.yml up -d --build --force-recreate --remove-orphans
- Create the sub container
Create the .NET GTK Sub container (in folder: ‘Afx-X11-Forward-NET-Service-GTK#’):
docker-compose -f compose_net_x11_gtksharp_project.yml up -d --build --force-recreate --remove-orphans
- Start the Docker sub container via the WSL (optional)
Execute the following commands:
wsl -d Ubuntu-docker-App-X11-Win32Dev docker exec -it afx-x11-forward-net-service-gtk-axf-dotnet-gtksharp-container-1 /bin/bash
Warning:
When the container cannot be found, restart the Docker app and ensure WSL integration is enabled in Docker settings!
- Start the sub-container in Visual Studio Code
Install the following extension(s) in the container
code --install-extension ms-dotnettools.csharp code --install-extension ms-dotnettools.csdevkit ~~code --install-extensionms-dotnettools.vscode-dotnet-runtime~~
The project Template and specific tasks in VSC
Project structure
After opening your project you find a ‘src’ folder with the following structure:
- src –» root source folder
- backend –» .NET class libraries. See VSC task: ‘2.1 AFX …’ below
- cl_example –» simple sample class library
- cl_example –» other sample class library, with simple Rest example
- frontend –» GTK3 csharp code
- Program.cs –» main program using the sample libraries
- backend –» .NET class libraries. See VSC task: ‘2.1 AFX …’ below
VSC Tasks
You can use the following tasks in Visual Studio Code:
Tasks | Used for |
---|---|
1.1 AFX Build GTK App (Debug Windows) | Debug Build all for the Windows platform |
1.2 AFX Build Release GTK App (Windows & Linux) | Release build ofr Linux and Windows Platforms |
2.1 AFX CREATE: Class Source Library | Creates a class library in the directory: src/backend/ see Remark 1 |
3.1 AFX Run GTKApp (Windows Release) | Run the app in release mode |
4.1 AFX Clean a specific Library | Cleans a specific class library |
4.2 AFX Clean the application | Cleans the frontend application |
4.3 AFX Clean ALL | Clean all libraries and frontend application |
Remark 1
Make sure the class library start with: ‘cl_‘ followed by a descriptive name. This makes sure:
* That the class libraries are created in a folder with that name on src\backend\cl_yourname*
* During the build process the cl_ is replaced with with ‘lib_‘ resulting into library: lib_yourname
* The clean tasks 4.x wil work properly, because they act on these names!
Side note: Preview Markdown Files(.md)
Preview Markdown Files(.md)
To preview the Markdown (.md) files in this project, one of the best solutions is to open these files in Visual Studio Code (VSC) and install the plugin: Markdown Preview GitHub Styling (Tested with version 2.04). Other plugins, or plugins for other programs, may not always work correctly with the file links in the documentation. I use the file link syntax supported by GitHub (Jekyll), which is also compatible with the above-mentioned plugin.
To display the Preview screen in VSC:
- Ensure that you are not working in Restricted mode.
- Click on the “file.md” tab and choose: “Open preview.”
- Alternatively, you can click the ‘Open Preview to the Side’ button at the top right.
Click here for more information on the Markdown Preview GitHub Styling plugin
Version: 1.0