IniToolsSharp 1.0.2

dotnet add package IniToolsSharp --version 1.0.2
                    
NuGet\Install-Package IniToolsSharp -Version 1.0.2
                    
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="IniToolsSharp" Version="1.0.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="IniToolsSharp" Version="1.0.2" />
                    
Directory.Packages.props
<PackageReference Include="IniToolsSharp" />
                    
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 IniToolsSharp --version 1.0.2
                    
#r "nuget: IniToolsSharp, 1.0.2"
                    
#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.
#:package IniToolsSharp@1.0.2
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=IniToolsSharp&version=1.0.2
                    
Install as a Cake Addin
#tool nuget:?package=IniToolsSharp&version=1.0.2
                    
Install as a Cake Tool

<p align="center"> <img src="https://github.com/kris701/IniToolsSharp/assets/22596587/058e2a34-1864-46e9-868c-cc94d6ae11d7" width="200" height="200" /> </p>

Build and Publish Nuget Nuget GitHub last commit (branch) GitHub commit activity (branch) Static Badge Static Badge Static Badge

INI Tools Sharp is a little project to manipulate and output INI files. You can find it on the NuGet Package Manager or the GitHub Package Manager.

How to Use

The package is inspired by that of System.Text.Json, where you can access two primary static methods, INISerialiser.Deserialise and INISerialiser.Serialise to convert generic classes into INI format and back. A class represents a section by giving it a IniSectionAttribute and a name.

Example

Test class to work with:

public class Section1
{
    public bool Value1 { get; set; } = false;
    public int Value2 { get; set; } = -1;
}
public class SomeSettings
{
    [IniSection("SectionName")]
    public Section1 Section { get; set; } = new Section1();
}

You can then serialise it into a INI file format:

var text = IniSerialiser.Serialise(new SomeSettings());

This will output text as follows:

[SectionName]
Value1=False
Value2=-1

The same text can be deserialised back into the SomeSettings object.

Example

You can also use simple list types as follows:

public class Section1
{
    public List<int> Values { get; set; } = new List<int>()
    {
        5,
        123,
        -1
    }
}
public class SomeSettings
{
    [IniSection("SectionName")]
    public Section1 Section { get; set; } = new Section1();
}

You can then serialise it into a INI file format:

var text = IniSerialiser.Serialise(new SomeSettings());

This will output text as follows:

[SectionName]
Values=[5,123,-1]

The same text can be deserialised back into the SomeSettings object.

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.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net8.0

    • No dependencies.

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
1.0.2 161 3/28/2024
1.0.1 134 3/27/2024
1.0.0 136 3/27/2024