{"id":22919500,"url":"https://github.com/communityvb/vazortopshelf","last_synced_at":"2026-01-08T08:40:05.971Z","repository":{"id":219517275,"uuid":"749247239","full_name":"CommunityVB/VazorTopShelf","owner":"CommunityVB","description":"A sample project demonstrating running a Vazor web application under Kestrel in a TopShelf service","archived":false,"fork":false,"pushed_at":"2024-01-30T00:43:51.000Z","size":772,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-07T08:30:01.566Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Visual Basic .NET","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/CommunityVB.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-01-28T01:49:55.000Z","updated_at":"2024-01-30T04:40:12.000Z","dependencies_parsed_at":"2024-12-14T07:12:40.816Z","dependency_job_id":"810ed2d7-efe7-4a0b-a955-65d9fac29e8b","html_url":"https://github.com/CommunityVB/VazorTopShelf","commit_stats":null,"previous_names":["intexx/vazortopshelf"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CommunityVB%2FVazorTopShelf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CommunityVB%2FVazorTopShelf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CommunityVB%2FVazorTopShelf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CommunityVB%2FVazorTopShelf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CommunityVB","download_url":"https://codeload.github.com/CommunityVB/VazorTopShelf/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246645825,"owners_count":20811031,"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":[],"created_at":"2024-12-14T07:12:14.472Z","updated_at":"2026-01-08T08:40:05.965Z","avatar_url":"https://github.com/CommunityVB.png","language":"Visual Basic .NET","funding_links":[],"categories":[],"sub_categories":[],"readme":"# VazorTopShelf\n\nThis sample demonstrates running a Vazor VB.NET Web application under Kestrel, hosted in a Windows Service using TopShelf.\n\nIt started as a simple .NET Core VB.NET Console application. The Project SDK value was updated from `Microsoft.NET.Sdk` to `Microsoft.NET.Sdk.Web` and the Vazor and TopShelf packages were added. Essential files were copied from a new Vazor-template-sourced project. Service-related classes were then moved to a separate `ServiceRunner` project, for improved separation of concerns.\n\nTo install the service, `dotnet publish` to your desired output directory, and then run the following command from an elevated command prompt in that directory:\n\n`VazorTopShelf.exe install`\n\nThis will install the service. You can then start it using `net start VazorTopShelf` or *services.msc*. With the service running, navigate to [http://localhost:5000/](http://localhost:5000/) to view the application and access its pages. At service start, a simple SQLite database will automatically be created in a new `Db\\Data` folder alongside `wwwroot` (if they don't exist already).\n\nThe installation is configured in the `Host.Run()` method to set the service's startup type to *Automatic (Delayed Start)*. You can change this setting to your liking by calling `HostConfig.Disabled()`, `HostConfig.StartManually()`, `HostConfig.StartAutomatically()` or `HostConfig.StartAutomaticallyDelayed()`.\n\nTo uninstall the service, run the following command from an elevated command prompt:\n\n`VazorTopShelf.exe uninstall`\n\nHere's a high-level view of how it works:\n\n1. The `Program` module is the entry point for the application. It initializes a `Host` instance, and then calls the `Host.Run()` method.\n2. `Host.Run()` sets the stage for the service, including specifying what happens when the service starts and stops.\n3. The `Manager.StartService()` method configures and invokes the constructor-provided `OnStart()` action�which in turn configures and starts the website�when the service starts. Note that the `WebApplication` class provides a `Run()` method, which blocks and listens on a port and which we normally use, but since TopShelf handles the blocking all we need here is the listening component, `StartAsync()`.\n\n## Notes\n\nCurrent date: Jan 27, 2024\n\n- EF Core 7.0.15 is used here, pending support for EF Core 8 in [EntityFrameworkCore.VisualBasic](https://www.nuget.org/packages/EntityFrameworkCore.VisualBasic/). This results in a design-time RID-related warning:\n\n  \u003e Found version-specific or distribution-specific runtime identifier(s): alpine-arm, alpine-arm64, alpine-x64. Affected libraries: SQLitePCLRaw.lib.e_sqlite3. In .NET 8.0 and higher, assets for version-specific and distribution-specific runtime identifiers will not be found by default. See https://aka.ms/dotnet/rid-usage for details.\n\n  See [https://github.com/sebastienros/yessql/issues/510](https://github.com/sebastienros/yessql/issues/510) for more information. The temporary workaround is to update the normally-transitive `SQLitePCLRaw.bundle_e_sqlite3` package to `2.1.7`. Once the VB.NET EF Core design-time tools are updated to support EF Core 8, this interim package update won't be necessary.\n\n- The Vazor repository is located at [https://github.com/VBAndCs/Vazor](https://github.com/VBAndCs/Vazor). The latest version (v2.1) is available at [https://marketplace.visualstudio.com/items?itemName=ModernVBNET.Vazor](https://marketplace.visualstudio.com/items?itemName=ModernVBNET.Vazor).\n- The TopShelf repository is located at [https://github.com/Topshelf/Topshelf](https://github.com/Topshelf/Topshelf).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcommunityvb%2Fvazortopshelf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcommunityvb%2Fvazortopshelf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcommunityvb%2Fvazortopshelf/lists"}