{"id":22800970,"url":"https://github.com/dailydevops/extensions.hosting.winforms","last_synced_at":"2025-04-19T18:23:16.746Z","repository":{"id":229706871,"uuid":"767744791","full_name":"dailydevops/extensions.hosting.winforms","owner":"dailydevops","description":"Provides a .NET hosting infrastructure for Windows Forms based on Microsoft.Extensions.Hosting","archived":false,"fork":false,"pushed_at":"2024-12-06T22:26:21.000Z","size":253,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":4,"default_branch":"main","last_synced_at":"2024-12-06T23:23:47.747Z","etag":null,"topics":["dotnet","hosting","winforms"],"latest_commit_sha":null,"homepage":"https://dailydevops.net","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dailydevops.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["dailydevops"]}},"created_at":"2024-03-05T20:29:50.000Z","updated_at":"2024-12-06T22:26:24.000Z","dependencies_parsed_at":"2024-05-20T10:45:22.855Z","dependency_job_id":"c55da584-a84d-4dbc-adbd-058f01686b55","html_url":"https://github.com/dailydevops/extensions.hosting.winforms","commit_stats":null,"previous_names":["dailydevops/extensions.hosting.winforms"],"tags_count":10,"template":false,"template_full_name":"dailydevops/dotnet-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dailydevops%2Fextensions.hosting.winforms","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dailydevops%2Fextensions.hosting.winforms/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dailydevops%2Fextensions.hosting.winforms/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dailydevops%2Fextensions.hosting.winforms/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dailydevops","download_url":"https://codeload.github.com/dailydevops/extensions.hosting.winforms/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":229352429,"owners_count":18059492,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dotnet","hosting","winforms"],"created_at":"2024-12-12T08:08:32.935Z","updated_at":"2024-12-12T08:08:33.381Z","avatar_url":"https://github.com/dailydevops.png","language":"C#","readme":"# NetEvolve.Extensions.Hosting.WinForms\n\n[![Nuget](https://img.shields.io/nuget/v/NetEvolve.Extensions.Hosting.WinForms?logo=nuget)](https://www.nuget.org/packages/NetEvolve.Extensions.Hosting.WinForms/)\n[![Nuget](https://img.shields.io/nuget/dt/NetEvolve.Extensions.Hosting.WinForms?logo=nuget)](https://www.nuget.org/packages/NetEvolve.Extensions.Hosting.WinForms/)\n\nThe main purpose of this package is to provide a way to use the `Microsoft.Extensions.Hosting` for WinForms applications, allowing the use of dependency injection, configuration, logging, and other features provided by the `Microsoft.Extensions` libraries.\n\n:bulb: This package is available for .NET 6.0 and later.\n\n## Contribution\n\nIf you have any suggestions, bug reports, or any other form of feedback, please feel free to open an issue or a pull request. Any contributions are welcome!\n\n## Why not .NET Standard?\nWith the .NET Standard Microsoft created a specification for APIs that are intended to be available on all .NET implementations. This was a great idea, but it also has some drawbacks. The main drawback is that the .NET Standard is a specification and not an implementation. This means that the real work is done by .NET implementations, such as .NET 5.0 and later versions. Which is why we decided us against the .NET Standard and for the concrete .NET implementations.\n\nSee [The future of .NET Standard](https://devblogs.microsoft.com/dotnet/the-future-of-net-standard/) for more details.\n\n## Installation\nTo use this package, you need to add the package to your project. You can do this by using the NuGet package manager or by using the dotnet CLI.\n```powershell\ndotnet add package NetEvolve.Extensions.Hosting.WinForms\n```\n\n## Usage\nTo use the `Microsoft.Extensions.Hosting` in a WinForms application, you just need to create a new `HostBuilder` and configure it as you would do in a console application.\n\n```csharp\nnamespace WinForms;\n\nusing Microsoft.Extensions.Hosting;\nusing NetEvolve.Extensions.Hosting.WinForms;\n\ninternal static class Program\n{\n    internal static async Task Main() =\u003e\n        await CreateHostBuilder().Build().RunAsync().ConfigureAwait(false);\n\n    public static IHostBuilder CreateHostBuilder() =\u003e\n        Host.CreateDefaultBuilder().UseWindowsForms\u003cForm1\u003e();\n}\n```\n\nTherefore, you can use for example the `Microsoft.Extensions.DependencyInjection` to register services and inject them into your forms.\n\n```csharp\nnamespace WinForms;\n\nusing Microsoft.Extensions.DependencyInjection;\nusing System.Windows.Forms;\n\npublic partial class Form1 : Form\n{\n    private readonly ILogger\u003cForm1\u003e _logger;\n\n    public Form1(ILogger\u003cForm1\u003e logger)\n    {\n        _logger = logger;\n        InitializeComponent();\n    }\n\n    private void Form1_Load(object sender, EventArgs e)\n    {\n        _logger.LogInformation(\"Form loaded.\");\n    }\n}\n```","funding_links":["https://github.com/sponsors/dailydevops"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdailydevops%2Fextensions.hosting.winforms","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdailydevops%2Fextensions.hosting.winforms","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdailydevops%2Fextensions.hosting.winforms/lists"}