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
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="AdamServices.Extensions.ServiceFileCreator" Version="0.1.6" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="AdamServices.Extensions.ServiceFileCreator" Version="0.1.6" />
                    
Directory.Packages.props
<PackageReference Include="AdamServices.Extensions.ServiceFileCreator" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add AdamServices.Extensions.ServiceFileCreator --version 0.1.6
                    
#r "nuget: AdamServices.Extensions.ServiceFileCreator, 0.1.6"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#addin nuget:?package=AdamServices.Extensions.ServiceFileCreator&version=0.1.6
                    
Install AdamServices.Extensions.ServiceFileCreator as a Cake Addin
#tool nuget:?package=AdamServices.Extensions.ServiceFileCreator&version=0.1.6
                    
Install AdamServices.Extensions.ServiceFileCreator as a Cake Tool

AdamServices.Extensions.ServiceFileCreator

.NET Publish Nuget Package And Release

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 of Development

    "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
    <PropertyGroup>
      ...
      <Version>1.0.1</Version>
      ...
    </PropertyGroup>
    
    Version format X.X.X
  • 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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
0.1.6 0 4/8/2025
0.1.5 39 4/8/2025
0.1.4 31 4/8/2025
0.1.2 40 4/8/2025
0.1.1 131 4/4/2025