Merge pull request #5096 from dotnet/runtimeinfo
Add dotnet-runtimeinfo tools
This commit is contained in:
commit
526cbb2241
|
@ -2,7 +2,8 @@
|
|||
|
||||
This directory contains .NET samples and documents.
|
||||
|
||||
* [dotnetsay tools](dotnetsay/README.md)
|
||||
* [dotnetsay tool](dotnetsay/README.md)
|
||||
* [dotnet-runtimeinformation tool](dotnet-runtimeinformation/README.md)
|
||||
* [Raspberry Pi instructions](RaspberryPiInstructions.md)
|
||||
* [Using Xml Serializer Generator on .NET Core](xmlserializergenerator-instructions.md)
|
||||
* [nuget.config for daily .NET builds](nuget.config)
|
||||
|
|
|
@ -4,13 +4,13 @@ using System.Reflection;
|
|||
using System.Runtime.InteropServices;
|
||||
using static System.Console;
|
||||
|
||||
namespace versioninfo
|
||||
namespace RuntimeEnvironment
|
||||
{
|
||||
class Program
|
||||
{
|
||||
static void Main(string[] args)
|
||||
{
|
||||
WriteLine("**.NET Core information");
|
||||
WriteLine("**.NET information");
|
||||
WriteLine($"{nameof(Environment.Version)}: {Environment.Version}");
|
||||
WriteLine($"{nameof(RuntimeInformation.FrameworkDescription)}: {RuntimeInformation.FrameworkDescription}");
|
||||
WriteLine($"Libraries version: {((AssemblyInformationalVersionAttribute[])typeof(object).Assembly.GetCustomAttributes(typeof(AssemblyInformationalVersionAttribute),false))[0].InformationalVersion.Split('+')[0]}");
|
|
@ -1,14 +1,16 @@
|
|||
# dotnet-versioninfo tool
|
||||
# dotnet-runtimeinfo tool
|
||||
|
||||
`dotnet-versioninfo` prints information about your .NET, OS and hardware environment. It is also a demonstration of the APIs you can use to get this information for your own uses. This information is likely useful for logging.
|
||||
`dotnet-runtimeinfo` prints information about your .NET, OS and hardware environment. It is also a demonstration of the APIs you can use to get this information for your own uses. This information is likely useful for logging.
|
||||
|
||||
You must have the .NET SDK installed, [.NET Core 3.1](https://dotnet.microsoft.com/download/dotnet-core/3.1) or higher.
|
||||
|
||||
## Installation
|
||||
|
||||
You can quickly install and try the [dotnet-versioninfo](https://www.nuget.org/packages/dotnet-versioninfo/):
|
||||
You can quickly install and try the [dotnet-runtimeinfo](https://www.nuget.org/packages/dotnet-runtimeinfo/):
|
||||
|
||||
```console
|
||||
dotnet tool install -g dotnet-versioninfo
|
||||
dotnet-versioninfo
|
||||
dotnet tool install -g dotnet-runtimeinfo
|
||||
dotnet-runtimeinfo
|
||||
```
|
||||
|
||||
> Note: You may need to open a new command/terminal window the first time you install a tool.
|
||||
|
@ -16,13 +18,13 @@ dotnet-versioninfo
|
|||
You can uninstall the tool using the following command.
|
||||
|
||||
```console
|
||||
dotnet tool uninstall -g dotnet-versioninfo
|
||||
dotnet tool uninstall -g dotnet-runtimeinfo
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
```console
|
||||
dotnet-versioninfo
|
||||
dotnet-runtimeinfo
|
||||
**.NET Core information
|
||||
Version: 3.1.7
|
||||
FrameworkDescription: .NET Core 3.1.7
|
|
@ -1,7 +1,6 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<AssemblyName>dotnet-versioninfo</AssemblyName>
|
||||
<Description>Displays .NET version and environment information.</Description>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>netcoreapp3.1</TargetFramework>
|
Loading…
Reference in a new issue