英文:
How to open MAUI Application from WinForms Application
问题
我正在开发一个 WinForms 应用程序,尝试从 WinForms 应用程序中打开 MAUI 应用程序。
因此,我想知道是否可以在 WinForms 应用程序内部以编程方式打开 MAUI 应用程序?
谢谢您的回答。
英文:
I am working on WinForms app which I'm trying to open MAUI application from WinForms application.
So, I'm wondering if it's possible to programmatically open a MAUI application from within a WinForms app?
Thank you for the answers.
答案1
得分: 1
在Windows上,Maui项目将由MSIX Application Packager打包。您可以在**/Platforms/Windows/Package.appxmanifest**文件中的</uap:VisualElements>
下面添加以下代码:
xmlns:uap5="http://schemas.microsoft.com/appx/manifest/uap/windows10/5"
......
....
</uap:VisualElements>
<Extensions>
<uap5:Extension
Category="windows.appExecutionAlias"
Executable="MauiAppTest.exe"
EntryPoint="Windows.FullTrustApplication">
<uap5:AppExecutionAlias>
<uap5:ExecutionAlias Alias="MyApp.exe" />
</uap5:AppExecutionAlias>
</uap5:Extension>
</Extensions>
然后,您可以使用Process.Start("MyApp.exe");
来启动WinForms应用程序中的Maui应用。
英文:
The maui proejct on the windows will be packaged by the MSIX Application Packager. You can add the following code below </uap:VisualElements>
in the /Platforms/Windows/Package.appxmanifest:
xmlns:uap5="http://schemas.microsoft.com/appx/manifest/uap/windows10/5"
.....
.....
</uap:VisualElements>
<Extensions>
<uap5:Extension
Category="windows.appExecutionAlias"
Executable="MauiAppTest.exe"
EntryPoint="Windows.FullTrustApplication">
<uap5:AppExecutionAlias>
<uap5:ExecutionAlias Alias="MyApp.exe" />
</uap5:AppExecutionAlias>
</uap5:Extension>
</Extensions>
And then, you can use the Process.Start("MyApp.exe");
to start the maui app in the WinForms Application.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论