Qml.net + .net core to create cross-platform desktop applications

Now on Github example to explain how to use https://github.com/qmlnet/qmlnet-examples

1, make sure the machine has been installed .net core sdk 2.2

2. Download the sample, reducing nuget package, compile the project, and then right-engineering point of release / publlish, configuration options released:

Deployment model: independent, it will automatically output all dependent projects to publish directories, so that the target machine does not need to install dotnet core runtime

Target runtime: win-x64, select the platform you want to publish, linux is linux-x64

Click Publish.

In the published folder midpoint Features.exe run it, or use the command: dotnet Features.dll

At this point you will find the interface does not start the actual download qt dependent project: qmlnet-qt-runtimes, after downloading will be displayed.

From start-up code

    RuntimeManager.DiscoverOrDownloadSuitableQtRuntime();

See the problem.

How the network is not good, the latter into the program directory can manually download

window 包:"https://github.com/qmlnet/qt-runtimes/releases/download/releases/qt-5.12.2-ad0689c-win-x64-runtime.tar.gz"

linux 包:"https://github.com/qmlnet/qt-runtimes/releases/download/releases/qt-5.12.2-ad0689c-linux-x64-runtime.tar.gz"

Creating qmlnet-qt-runtimes folder in the root directory, unpack the window to qt-5.12.2-ad0689c-win-x64, which structure

qmlnet-qt-runtimes

                            |--------qt-5.12.2-ad0689c-win-x64

                                                                                |----qt

                                                                                |----version.txt

 

linux correspondence is to qt-5.12.2-ad0689c-win- x64 to qt-5.12.2-ad0689c-linux- x64.

Be careful not to unpack in the window qt-5.12.2-ad0689c-linux-x64-runtime.tar.gz, because it does not recognize some of the linux link in the windows,

All required decompression on linux.

For the console window will open the windows, you can install NSubsys of nuget package to solve, and then install the release there will be no console window displays

 

Guess you like

Origin www.cnblogs.com/karl-F/p/11290592.html