ProjectInformation 1.0.1
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package ProjectInformation --version 1.0.1
NuGet\Install-Package ProjectInformation -Version 1.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="ProjectInformation" Version="1.0.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="ProjectInformation" Version="1.0.1" />
<PackageReference Include="ProjectInformation" />
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 ProjectInformation --version 1.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: ProjectInformation, 1.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.
#:package ProjectInformation@1.0.1
#: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=ProjectInformation&version=1.0.1
#tool nuget:?package=ProjectInformation&version=1.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
DotNetProjectInformation
A utility library to extract project configuration and package dependencies from .NET projects.
๐ Description
DotNetProjectInformation is a reusable utility library designed for .NET 8 / .NET Standard 2.1+ projects. It helps developers:
- ๐ Read settings from
appsettings.json
- ๐งฑ Inspect assembly/project metadata
- ๐ฆ Extract all installed NuGet packages
- ๐ Detect
.csproj
files recursively in a solution - ๐ ๏ธ Print referenced assemblies
๐ Features
ConfigurationReader
: Read values fromappsettings.json
by key or print all settings.AssemblyInfoHelper
: Get the current assembly name and target framework.PackageInspector
: Inspect all referenced NuGet packages for each project.ProjectConfigFetcher
: Access configuration settings using a simplified wrapper.DependencyFetcher
: Print referenced assembly names from the current context.
๐ฆ Dependencies
Dependencies shown below are used in the sample:
- Microsoft.Extensions.Configuration
- Microsoft.Extensions.Configuration.Json
- Microsoft.Extensions.Configuration.EnvironmentVariables
- Microsoft.Extensions.Configuration.FileExtensions
- Microsoft.Extensions.Configuration.Binder
- Newtonsoft.Json
๐งช Sample Usage
Sample File: SampleExampleConsoleProjectInformation.cs
using ProjectInformation;
using Service = ProjectInformation.Services;
using Utils = ProjectInformation.Utils;
var configReader = new Service.ConfigurationReader(AppContext.BaseDirectory, "Development");
// Print all settings
configReader.PrintAllAppSettings();
// Get specific value
Console.WriteLine(configReader.GetValue("MyApp:AppName"));
// Assembly info
Console.WriteLine(Utils.AssemblyInfoHelper.GetAssemblyName());
Console.WriteLine(Utils.AssemblyInfoHelper.GetFramework());
// Find all projects and inspect packages
var projectFiles = Service.PackageInspector.FindAllProjectFiles(@"F:\IPS\employee-attendance");
foreach (var projectFile in projectFiles)
{
var root = Service.PackageInspector.FindProjectRoot(projectFile);
if (root != null)
{
var packages = Service.PackageInspector.GetInstalledPackages(root);
packages.ForEach(p => Console.WriteLine(p));
}
}
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. 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. 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. |
.NET Core | netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.1 is compatible. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
.NETStandard 2.1
- Microsoft.Extensions.Configuration (>= 9.0.3)
- Microsoft.Extensions.Configuration.EnvironmentVariables (>= 9.0.3)
- Microsoft.Extensions.Configuration.FileExtensions (>= 9.0.3)
- Microsoft.Extensions.Configuration.Json (>= 9.0.3)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 9.0.3)
- Newtonsoft.Json (>= 13.0.3)
- System.Configuration.ConfigurationManager (>= 9.0.3)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.