-
-
Notifications
You must be signed in to change notification settings - Fork 378
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixing the UWP crashes (continuing #216) #310
Comments
Great to have you back on the UWP quest!
You can't do XML manipulation, however you could try using configure_file to do variable substitution on an XML template. |
Thanks for the suggestion! I'll come back to this hopefully by the end of this week. |
Uwp fix (addressing #310 with the error dialog popping up)
As the way to support applications in uwp is now known, I will continue this line of work to support the examples... soon... |
Finally I had time to come back! So, which seemingly was a crash (see #216) was neither an actual crash or something caused by a missing dll. It was UWP by default expecting all applications to be GUI and complaining about the libdatachannel applications not having an "App" class with methods like OnLaunched, OnSuspending, and OnNavigationFailed in it!
So, the fix is stating the libdatachannel applications are not GUI but console. When running CMake to create a Visual Studio Solution, CMake auto-generates a package.appxManifest file per executable. To claim the executables are console, these appxManifest files need to be manipulated as below:
Add two attributes to the tag
xmlns:desktop4="http://schemas.microsoft.com/appx/manifest/desktop/windows10/4"
xmlns:iot2="http://schemas.microsoft.com/appx/manifest/iot/windows10/2"
Add four attributes to tags inside the tag.
desktop4:Subsystem="console"
desktop4:SupportsMultipleInstances="true"
iot2:Subsystem="console"
iot2:SupportsMultipleInstances="true"
This information comes from this website (https://docs.microsoft.com/en-us/windows/uwp/launch-resume/console-uwp) and attached is an appxManifest file modified for datachannel-benchmark provided as an example.
package.appxManifest.txt
The problem here is that I don't think CMake currently supports adding those attributes by a flag or something. So, to fix this UWP crashing issue, an approach would be adding the above attributes via XML manipulation. While I am not even sure XML manipulation can be done inside a CMake script, I will try it soon...
p.s. One positive thing I have learned is that actually your applications were working fine. The crashes happen after completely running main() and does not cause any actual problems. It was just having an error alerting window, which is terribly unappealing, at the end of execution.
The text was updated successfully, but these errors were encountered: