Woof.Assembly 5.0.1

Prefix Reserved
dotnet add package Woof.Assembly --version 5.0.1                
NuGet\Install-Package Woof.Assembly -Version 5.0.1                
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="Woof.Assembly" Version="5.0.1" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Woof.Assembly --version 5.0.1                
#r "nuget: Woof.Assembly, 5.0.1"                
#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.
// Install Woof.Assembly as a Cake Addin
#addin nuget:?package=Woof.Assembly&version=5.0.1

// Install Woof.Assembly as a Cake Tool
#tool nuget:?package=Woof.Assembly&version=5.0.1                

Woof.Assembly

.NET extension created by CodeDog

Distributed under MIT License. (c)2021 by CodeDog, All rights reserved.


About

This is a tiny extension for the System.Reflection.Assembly class that provides information about the assembly file.

When the program needs to access information about an assembly location (that is directory and file name) - it should not use the Location property.

When the assembly is built / published as a single file, this property value will be null.

Also, Linux builds will have either no extension (for native executables), or a .dll extension. For Windows builds it will be either .exe or .dll.

On Linux, the Location property, if set, can have an .exe extension, that cannot be run either by itself or with the dotnet command.

The GetFileInfo extension mehtod will return always the correct extension for the assembly file, both for Linux and Windows, also when the project is published with the PublishSingleFile option.

For more information please read the API Incompatibility section of:

https://docs.microsoft.com/en-us/dotnet/core/deploying/single-file

Usage

To get the main executable file info:

var fileInfo = Assembly.GetEntryAssembly()!.GetFileInfo();

To get the directory of the calling assembly:

var directory = Assembly.GetCallingAssembly()!.GetFileInfo().DirectoryName;

Disclaimer

Please report any issues to the toolkit developer.

Woof Toolkit is a work in progress in constant development, however it's carefully maintained with production code quality.

Product Compatible and additional computed target framework versions.
.NET net5.0 is compatible.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net5.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.

FIX: Moved extension class to Woof namespace to solve namespace conflict.