mirror of
https://github.com/qmlnet/qmlnet.git
synced 2026-05-15 14:15:54 -06:00
[GH-ISSUE #146] Can't find Main.qml unless <RunWorkingDirectory> property set in .csproj #88
Labels
No labels
bug
enhancement
help wanted
help wanted
pull-request
question
todo
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: github-starred/qmlnet#88
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @zzstuzor on GitHub (Jun 23, 2019).
Original GitHub issue: https://github.com/qmlnet/qmlnet/issues/146
Have got the example project working - very cool.
Tried to create my own, couldn't get it working. Even copying all the code directly out of the example project. Tried everything, eventually narrowed it down to a property that exists in the Features.csproj in the example, and it doesn't work unless this is set.
Sharing in case others have the same problem.
Was this something you added to the .csproj manually? Or is there some step to add this in project settings or during some process?
@vadi2 commented on GitHub (Jun 23, 2019):
I don't have it set (https://github.com/health-validator/Hammer/blob/master/Hammer.csproj) and things seem to be working out OK.
@pauldotknopf commented on GitHub (Jun 27, 2019):
@zzstuzor, you are correct. The samples, as they are, require
Main.qmlto be in the current working directory.This can be changed by changing where you load the QML (
qmlEngine.Load("Main.qml");). You could put theMain.qmlanywhere, just make sure you reference it correctly inLoad(string qmlPath).Side note, there is plan to support loading QML files from embedded .NET resources (#15).
@vadi2 commented on GitHub (Jun 27, 2019):
And if you'd like to use the new
PublishSingleFileoption which unzips your dll are runtime to a location unknown to you, you can useengine.Load(Path.Combine(Path.GetDirectoryName(Assembly.GetEntryAssembly()?.Location), "Main.qml"));to load the file.@zzstuzor commented on GitHub (Jun 30, 2019):
@pauldotknopf ok right I see, that makes sense.
This sounds awesome. For deploying an application with dotnet it seems most appropriate to have those QML files embedded somehow.
This also sounds like an alternative. I'll try to test this out in the next few weeks/months. I'm very interested in developing a cross-platform app, but I'm doing it in my spare time. Each night I try to learn more about QML.
I still can't get the demo application running on my linux machine though :-\
@vadi2 commented on GitHub (Jun 30, 2019):
Check my Hammer app - I'm making it on Ubuntu, and it runs on macOS and Windows as well.