StockSharp.Configuration 5.0.219

Prefix Reserved
dotnet add package StockSharp.Configuration --version 5.0.219
                    
NuGet\Install-Package StockSharp.Configuration -Version 5.0.219
                    
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="StockSharp.Configuration" Version="5.0.219" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="StockSharp.Configuration" Version="5.0.219" />
                    
Directory.Packages.props
<PackageReference Include="StockSharp.Configuration" />
                    
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 StockSharp.Configuration --version 5.0.219
                    
#r "nuget: StockSharp.Configuration, 5.0.219"
                    
#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 StockSharp.Configuration@5.0.219
                    
#: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=StockSharp.Configuration&version=5.0.219
                    
Install as a Cake Addin
#tool nuget:?package=StockSharp.Configuration&version=5.0.219
                    
Install as a Cake Tool

StockSharp.Configuration

StockSharp.Configuration is a .NET Standard library that centralizes various configuration facilities used by the StockSharp trading platform. It provides classes for storing application paths, loading settings, managing user credentials, and constructing message adapters. The assembly is titled S#.Configuration and described as "Configuration components."

Features

  • System paths – the Paths class defines all important directories and files used by StockSharp. Paths are initialized from PathsHolder and configuration files, as shown below:
    var companyPath = PathsHolder.CompanyPath ?? ConfigManager.TryGet<string>("companyPath");
    CompanyPath = companyPath.IsEmpty() ? Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), "StockSharp") : companyPath.ToFullPathIfNeed();
    CredentialsFile = Path.Combine(CompanyPath, $"credentials{DefaultSettingsExt}");
    PlatformConfigurationFile = Path.Combine(AppDataPath, $"platform_config{DefaultSettingsExt}");
    
    【F:Configuration/Paths.cs†L14-L26】
  • Start‑up settingsAppStartSettings stores language preference and online/offline mode and can be loaded or saved from the platform configuration file:
    public class AppStartSettings : IPersistable
    {
        public string Language { get; set; } = LocalizedStrings.ActiveLanguage;
        public bool Online { get; set; } = true;
        public static AppStartSettings TryLoad()
        {
            var configFile = Paths.PlatformConfigurationFile;
            if (configFile.IsEmptyOrWhiteSpace() || !configFile.IsConfigExists())
                return null;
            return configFile.Deserialize<SettingsStorage>()?.Load<AppStartSettings>();
        }
    }
    
    【F:Configuration/AppStartSettings.cs†L4-L41】
  • Credentials management – the ICredentialsProvider interface allows loading, saving and deleting of ServerCredentials. The default implementation persists credentials in Paths.CredentialsFile:
    public interface ICredentialsProvider
    {
        bool TryLoad(out ServerCredentials credentials);
        void Save(ServerCredentials credentials, bool keepSecret);
        void Delete();
    }
    
    【F:Configuration/ICredentialsProvider.cs†L4-L25】
    class DefaultCredentialsProvider : ICredentialsProvider
    {
    
  • private readonly Lock _lock = new();
    private ServerCredentials _credentials;
    bool ICredentialsProvider.TryLoad(out ServerCredentials credentials)
    {
        using (_lock.EnterScope())
        {
            if(_credentials != null)
            {
                credentials = _credentials.Clone();
                return credentials.CanAutoLogin();
            }
            var file = Paths.CredentialsFile;
            credentials = null;
            if (file.IsConfigExists())
            {
                credentials = new ServerCredentials();
                credentials.LoadIfNotNull(file.Deserialize<SettingsStorage>());
                _credentials = credentials.Clone();
            }
            return credentials?.CanAutoLogin() == true;
        }
    }
    
    }
    【F:Configuration/DefaultCredentialsProvider.cs†L3-L38】
    
  • Invariant serializationInvariantCultureSerializer saves configuration files using the invariant culture and UTF‑8 encoding, enabling culture‑independent settings:
    public static class InvariantCultureSerializer
    {
        public static void SerializeInvariant(this SettingsStorage settings, string fileName, bool bom = true)
        {
            if (settings is null)
                throw new ArgumentNullException(nameof(settings));
            Do.Invariant(() => settings.Serialize(fileName, bom));
        }
    }
    
    【F:Configuration/InvariantCultureSerializer.cs†L3-L23】
  • Message adapter discoveryInMemoryMessageAdapterProvider scans all local assemblies for IMessageAdapter implementations and can create adapters on demand:
    public class InMemoryMessageAdapterProvider : IMessageAdapterProvider
    {
        public InMemoryMessageAdapterProvider(IEnumerable<IMessageAdapter> currentAdapters, Type transportAdapter = null)
        {
            CurrentAdapters = currentAdapters ?? throw new ArgumentNullException(nameof(currentAdapters));
            var idGenerator = new IncrementalIdGenerator();
            PossibleAdapters = [.. GetAdapters().Select(t =>
            {
                try
                {
                    return t.CreateAdapter(idGenerator);
                }
                catch (Exception ex)
                {
                    ex.LogError();
                    return null;
                }
            }).WhereNotNull()];
        }
    }
    
    【F:Configuration/InMemoryMessageAdapterProvider.cs†L5-L51】
  • Utility helpers – the Paths class also exposes methods for serialization, backup management and building links to StockSharp documentation and store pages.

Usage

  1. Configure global paths before accessing Paths by setting PathsHolder.CompanyPath and PathsHolder.AppDataPath if your application uses custom directories.
  2. Load or create application start settings with AppStartSettings.TryLoad and save them using TrySave.
  3. Implement ICredentialsProvider or use DefaultCredentialsProvider to persist server credentials securely.
  4. Use InvariantCultureSerializer when you need stable serialization irrespective of system locale.
  5. Create an instance of InMemoryMessageAdapterProvider to dynamically discover available message adapters.
Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  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.

NuGet packages (6)

Showing the top 5 NuGet packages that depend on StockSharp.Configuration:

Package Downloads
StockSharp.Algo

Trading algorithms. More info on web site https://stocksharp.com/store/

StockSharp.Licensing

Licensing components. More info on web site https://stocksharp.com/store/

StockSharp.Server.Core

Core server components. More info on web site https://stocksharp.com/store/

StockSharp.UdpDumper.Console

UDP Dumper. Console version

StockSharp.Algo.Compilation

Compilation components. More info on web site https://stocksharp.com/store/

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
5.0.219 23 3/6/2026
5.0.218 3,414 9/11/2025
5.0.217 845 9/1/2025
5.0.216 834 8/30/2025
5.0.215 961 8/10/2025
5.0.214 1,274 7/23/2025
5.0.213 1,251 7/20/2025
5.0.212 1,073 7/14/2025
5.0.211 800 7/8/2025
5.0.210 707 7/4/2025
5.0.209 757 6/30/2025
5.0.208 1,412 6/20/2025
5.0.207 745 6/18/2025
5.0.206 881 6/2/2025
5.0.205 1,007 5/14/2025
5.0.204 1,583 3/29/2025
5.0.203 731 3/27/2025
5.0.202 1,759 2/26/2025
5.0.201 1,755 2/14/2025
5.0.200 1,913 12/30/2024
Loading failed

Remove common_target_standard*.props, migrate all projects to common_target_net.props
Extract .NET version into NetVer/NetTfm/NetOldTfm constants in common_versions.props
Fix async stream disposal in DeserializeOrThrowAsync
Assembly. GetAdapters extension.
IPermissionCredentialsStorage uses async model.
mark Paths Serialize/Deserialize without IFileSystem as obsolete
add IFileSystem support to FileCredentialsStorage with tests
DefaultCredentialsProvider: add IFileSystem support
IFileSystem abstraction for storage classes.
NuGet v7.0.1
IAsyncMessageAdapter merged with IMessageAdapter.
Lock usage.
AppStartSettings. TimeZone
DateTimeOffset -> DateTime UTC
IMessageAdapterProvider. CreateTransportAdapter uses IAsyncMessageAdapter.
SubscriptionConfig
IPermissionCredentialsStorage
ITransactionIdStorage
MakeFullPath extension.
Paths. DeserializeWithMigration removed as obsolete.
FindAdapters extension.