AdamServices.Extensions.ServiceFileCreator
0.1.6
dotnet add package AdamServices.Extensions.ServiceFileCreator --version 0.1.6
NuGet\Install-Package AdamServices.Extensions.ServiceFileCreator -Version 0.1.6
<PackageReference Include="AdamServices.Extensions.ServiceFileCreator" Version="0.1.6" />
<PackageVersion Include="AdamServices.Extensions.ServiceFileCreator" Version="0.1.6" />
<PackageReference Include="AdamServices.Extensions.ServiceFileCreator" />
paket add AdamServices.Extensions.ServiceFileCreator --version 0.1.6
#r "nuget: AdamServices.Extensions.ServiceFileCreator, 0.1.6"
#addin nuget:?package=AdamServices.Extensions.ServiceFileCreator&version=0.1.6
#tool nuget:?package=AdamServices.Extensions.ServiceFileCreator&version=0.1.6
AdamServices.Extensions.ServiceFileCreator
Utility for creating service files used by AdamServices.Utilities.Managment , serving as an extension for Microsoft Dependency Injection (DI), and used to standardize the type definition of service files across all projects built within the Managment project.
For users
Install
.NET CLI
dotnet add package AdamServices.Extensions.ServiceFileCreator
Package Manager
NuGet\Install-Package AdamServices.Extensions.ServiceFileCreator
Update the configuration of the DI project
Add ServiceFileCreator initialization to the service configurations
.ConfigureServices((context, services) => { services.AddAdamServiceFileCreator(); })
After building the hostbuilder, call the ServiceFileCreator in this way:
host.UseAdamServiceFileCreator();
Set the
DOTNET_ENVIRONMENT
environment variable of the project to the value ofDevelopment
"environmentVariables": { "DOTNET_ENVIRONMENT": "Development" }
An example can be viewed in the test project.
Create service file
After launching the application, the service_info.json
file will appear in the root directory of the repository. In this case, the project should have the following
RepositoryName == AdamServices.SolutionName (e.g. AdamServices.FindRobot)
|
| -- src
| |
| |-- SolutionName (e.g. FindRobot)
| |
| | -- SolutionName.csproj (e.g. FindRobot)
|
| -- AdamServices.SolutionName (e.g. AdamServices.FindRobot)
| -- service_info.json << here it is, the service file
| -- other files (README, LICENSE, git files, etc)
Description of the service file
Fields are filled in automatically:
"services": {
"name": "FindRobot",
"version": "1.0.1.2",
"projectType": "DotnetProject",
},
name
- it is automatically substituted from the assembly name, or changed to the assembly name if the name in the field does not match it. To change this field, you should change the project name.
version
- It is automatically substituted from the build version, or changed to the build version if the entry in the field does not match it. To change this field, you should change the project version.
<PropertyGroup>
...
<Version>0.1.1</Version>
...
</PropertyGroup>
projectType
- It is filled in automatically. Default value: DotnetProject
The remaining fields of the service file are filled in manually, depending on the technical specifications of the project.
For developers
Publishing releases
To publish a release, you need to:
- Upgrade the version in the project configuration and commit the changes
Version format X.X.X<PropertyGroup> ... <Version>1.0.1</Version> ... </PropertyGroup>
- Mark the commit with a tag of the format: v.X.X.X e.g. version 1.0.1 tag v.1.0.1
- Push commits and tags. The release will be published automatically.
Important!
- Technically, it doesn't matter which version is specified in the project configuration, the version number is taken from the tag. They may differ, for example, as a result of an error or carelessness. Preference should be given to the version specified in the tag.
- The trigger for publishing a release is a xxx format tag. From any branch.
What's going on at CI?
- Building a library with a project and a test application to which the library is linked via a link to the project
- Packaging the library in a nuget package
- Launching a test application that creates a file, services_info.json with fields filled in by default
- Publishing packages on nuget and github package
- Publication of the release to which the following are attached: source codes, nuget package version, services_info.json file with fields filled in by default
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. |
-
net8.0
- Microsoft.Extensions.Hosting.Abstractions (>= 9.0.3)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.