-
Notifications
You must be signed in to change notification settings - Fork 982
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
Add a generic host lifetime for Windows Forms #2861
Comments
Thank you, it looks very interesting. However to take it further we'd appreciate it if you filled the provided template and explained the following:
As you may understand we can't depend on 3rd party packages for a number of reasons (e.g. security and reliability). This means the proposed functionality will have to be built-in to Windows Forms codebase. In order to do so, the following will need to go through the following steps:
This is an involved process, and I am happy to work with you, if you think the API you are proposing will be useful to Windows Forms users world-wide. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
@oswaldtech Thanks for your effort on this! It would help if you could give code examples in this issue. That would help us and the API review team understand the need and general usefulness of the API. Specifically:
We'd also need some sort of appraisal/estimate of startup impact, if any. Here is the link on the API review process. It has a link to a good API proposal that can help. Most of the people looking at this (including me) won't be intimately familiar with the hosting APIs, so try and write to that audience. One final (but important) note, adding a new library and package isn't a trivial cost, so it would need to be very clear that the demand is high enough to bring this in as opposed to relying an external package (your library in this case). |
This submission has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 14 days. It will be closed if no further activity occurs within 7 days of this comment. |
@alex-oswald - if this is something you're still interested in pursuing, could you please follow the instructions @JeremyKuhne sent above"
I'll reopen the issue and see where this goes. |
anythins? |
This submission has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 14 days. It will be closed if no further activity occurs within 7 days of this comment. |
Yup. I'll start spinning cycles after the holiday break. |
@merriemcgaw It's been a busy few months at work but my API proposal is done. Shall I create a new issue with the proposal? Or update the original post? |
We added an issue template for the purpose of API Suggestions. I'd probably recommend filing the new issue with the required information. Then link this issue to it and I'll close this as a duplicate. Please be aware we have to follow the API Review process to get it reviewed by .NET API reviewers and follow their recommendations. |
API Proposal #11415 |
Closing in favor of #11415 |
Enterprise customers want to keep using Windows Forms, and we want to use the generic host.
Can we add a feature to use the generic host with Windows Forms and use the lifetime of the start up form such as this library I created?
https://github.com/oswald-technologies/WindowsFormsLifetime
https://github.com/dotnet/extensions/issues/2949
Benefits this functionality will provide to Windows Forms customers.
The main benefit: allows WinForms developers to easily utilize .NET Core's generic host and have the host gracefully shutdown when the start form is closed.
This in turn lets you use the default host builder in the same way it is used for ASP.NET Core applications.
Further, this allows the use of dependency injection, configuration, logging, and more in WinForms applications without manual setup.
What use cases it will enable, and where it may not be appropriate.
Use dependency injection, configuration, logging with WinForms (and a lot of other .NET Core extensions).
Run background tasks in WinForms with
IHostedService
s.Run the GUI on a separate thread to increase performance.
Performance implications.
Using a
WindowsFormsLifetime
should help increase performance because the WinForms GUI will by default, run on a separate thread. Typically now, you start with the default WinForms template, which runs everything on the GUI thread. I believe most people usually run with this instead of spawning other threads for work. Especially in the Enterprise realm, where we develop WinForms apps quickly for internal use only.How it would coincide with the VS Designer, etc.
This has a direct correlation with the VS Designer because it is intended to be used with Forms.
My suggestion is to have this be its own extension package, similar to:
https://github.com/dotnet/extensions/tree/master/src/Hosting/WindowsServices
The text was updated successfully, but these errors were encountered: