[GH-ISSUE #178] App using native hosting crashes immediately #113

Closed
opened 2026-05-05 11:05:21 -06:00 by gitea-mirror · 2 comments
Owner

Originally created by @BrianAllred on GitHub (Dec 12, 2019).
Original GitHub issue: https://github.com/qmlnet/qmlnet/issues/178

I've set up native hosting like the documentation specifies (only difference is I moved TestObject to its own file within the namespace). When I run, I get the error below.

Unhandled exception. System.Exception: Args is invalid, must contain three entries which are pointers to native types.
   at Qml.Net.Host.Run(String[] args, Func`5 action)
   at QmlYodel.Program.Main(String[] _) in /home/brian/Documents/QmlYodel/net/Program.cs:line 16
18:14:37: The program has unexpectedly finished.

Line 16 is the return Host.Run(... line.

Originally created by @BrianAllred on GitHub (Dec 12, 2019). Original GitHub issue: https://github.com/qmlnet/qmlnet/issues/178 I've set up native hosting like the documentation specifies (only difference is I moved TestObject to its own file within the namespace). When I run, I get the error below. ``` Unhandled exception. System.Exception: Args is invalid, must contain three entries which are pointers to native types. at Qml.Net.Host.Run(String[] args, Func`5 action) at QmlYodel.Program.Main(String[] _) in /home/brian/Documents/QmlYodel/net/Program.cs:line 16 18:14:37: The program has unexpectedly finished. ``` Line 16 is the `return Host.Run(...` line.
Author
Owner

@pauldotknopf commented on GitHub (Dec 12, 2019):

I suspect you are using the native from git, while using the .NET lib from NuGet. The native/net libs must be aligned.

I recommend adding "QmlNet" as a submodule. Compile in the native bits (including the .pri file), and refernce the Qml.Net.csproj project directly from the submodule (instead of from Nuget).

<!-- gh-comment-id:564792834 --> @pauldotknopf commented on GitHub (Dec 12, 2019): I suspect you are using the native from git, while using the .NET lib from NuGet. The native/net libs must be aligned. I recommend adding "QmlNet" as a submodule. Compile in the native bits (including the .pri file), and refernce the Qml.Net.csproj project directly from the submodule (instead of from Nuget).
Author
Owner

@BrianAllred commented on GitHub (Dec 12, 2019):

Your suspicion was correct, thanks!

<!-- gh-comment-id:564796108 --> @BrianAllred commented on GitHub (Dec 12, 2019): Your suspicion was correct, thanks!
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/qmlnet#113
No description provided.