You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Name - Display name of the assembly to retrieve a version from, as determined by its FullName property. The assembly will be loaded if needed. If not specified, will use the entry assembly (this did not function correctly for .NET Core until NLog.Web.AspNetCore 4.6). Introduced in NLog 4.3.7.
Type - Type of the assembly version value to retrieve. Default: Assembly.
Introduced with NLog v4.5.
Introduced for ASP.NET with NLog.Web / NLog.Web.AspNetCore v4.6.
Possible enum values:
Assembly - Assembly version. Value for AssemblyVersion attribute.
Note: UWP earlier than .NET Standard 1.5 uses value for ApplicationVersion
File - File version. Value for AssemblyFileVersion attribute.
Notes:
UWP earlier than .NET Standard 1.5 uses Assembly instead unless a value is given for the name parameter
Informational - Product Version extracted from AssemblyInformationalVersion attribute.
Notes:
UWP earlier than .NET Standard 1.5 uses Assembly instead unless a value is given for the name parameter
Default - Custom value to output when assembly version cannot be found, is empty or matches 0.0.0.0
Introduced with NLog 5.0.2
Remarks
As this layout renderer uses reflection and version information is unlikely to change during application execution, it is recommended to use it in conjunction with the CachedLayoutRendererWrapper. The entry assembly can't be found in some cases e.g. ASP.NET, unit tests, etc.
Examples
Retrieve assembly version for entry assembly:
${assembly-version}
Retrieve assembly version for assembly name NLogAutloadExtension:
${assembly-version:NLogAutloadExtension}
Retrieve file version for entry assembly:
${assembly-version:type=File}
Retrieve informational version for assembly name NLogAutloadExtension: