简体   繁体   English

如何为在自己的Windows进程中运行的WPF应用程序构建模块?

[英]How to build modules for a WPF application that run in their own Windows processes?

I'm building my first WPF application which is basically a container window that loads a few pages or "modules" within it. 我正在构建我的第一个WPF应用程序,该应用程序基本上是一个容器窗口,在其中加载了几页或“模块”。 This works, however I would like to make each module its own process within Windows so it could be force quit and wouldn't affect the rest of the application. 这行得通,但是我想在Windows中使每个模块都有自己的进程,因此可以强制退出它,并且不会影响应用程序的其余部分。

As an example, I'd use Google's Chrome. 例如,我将使用Google的Chrome。 Each tab runs in its own Windows process, and Chrome even has its own internal task manager to manage them. 每个标签页都在其自己的Windows进程中运行,Chrome甚至具有自己的内部任务管理器来管理它们。 This is what I would like to accomplish but I'm not sure of the best way. 这是我要完成的工作,但我不确定最佳方法。

Do I have to create a separate project for each module and then run each executable within my MainWindow? 我是否必须为每个模块创建一个单独的项目,然后在MainWindow中运行每个可执行文件? I would prefer to be able to do this from within one project. 我希望能够从一个项目中做到这一点。

Use application domains to isolate tasks that might bring down a process. 使用应用程序域隔离可能导致进程中断的任务。 If the state of the AppDomain that's executing a task becomes unstable, the AppDomain can be unloaded without affecting the process. 如果正在执行任务的AppDomain的状态变得不稳定,则可以卸载AppDomain而不影响过程。 This is important when a process must run for long periods without restarting. 当进程必须长时间运行而不重新启动时,这一点很重要。 You can also use application domains to isolate tasks that should not share data 您还可以使用应用程序域来隔离不应共享数据的任务

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何从WPF应用程序方法运行Windows Service应用程序 - How to run a Windows Service Application from a WPF application method 将WPF应用程序作为Windows服务运行 - Run a WPF Application as a Windows Service 如何运行在服务而不是后台进程下运行的 c# windows 服务应用程序? - How to run c# windows service application run under services rather than background processes? 如何在Windows 2016 Server上运行.net Framework 4构建应用程序? - How to run .net framework 4 build application on Windows 2016 Servers? 如何从Windows Powershell构建运行vNext应用程序? - How to build-run vNext application from Windows Powershell? 添加WPF Desktop Projects应用程序(具有多个模块)以构建InstallShield安装程序 - Adding WPF Desktop Projects Application(with multiple modules) to build InstallShield Setup 如何在WPF应用程序Combobox / ListView上动态加载正在运行的进程列表? - How to dynamically onload a list of running processes on a WPF Application Combobox/ ListView? 如何构建可以在窗口之间拖放用户控件的 WPF 应用程序? - How do I build a WPF application where I can drag and drop a user control between windows? 如何在 wpf 应用程序中运行 exe 应用程序? - How to run exe application inside wpf application? 如何在不使用任何代码的情况下在 Windows 启动时运行 WPF 应用程序 - How Can I Run the WPF application at Windows startup without using any code
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM