question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add `dotnet inspect` command

See original GitHub issue

This is the experience creating a console app.

rich@M1 ~ % dotnet new console -o console     
The template "Console Application" was created successfully.

Processing post-creation actions...
Running 'dotnet restore' on /Users/rich/console/console.csproj...
  Determining projects to restore...
  Restored /Users/rich/console/console.csproj (in 129 ms).
Restore succeeded.

rich@M1 ~ % cat console/Program.cs 
// See https://aka.ms/new-console-template for more information
Console.WriteLine("Hello, World!");

Invariably, the first line of Program.cs will be deleted by the user. That’s unfortunate UX.

Please consider putting/sharing this comment in the template creation output and/or in the project file instead.

Some combination of the following would be great, with a bias to updating the console output only.

rich@M1 ~ % dotnet new console -o console     
The template "Console Application" was created successfully.

See https://aka.ms/new-console-template for more information
on the new .NET 6 templates.

Processing post-creation actions...
Running 'dotnet restore' on /Users/rich/console/console.csproj...
  Determining projects to restore...
  Restored /Users/rich/console/console.csproj (in 129 ms).
Restore succeeded.
rich@M1 ~ % cat console/Program.cs 
Console.WriteLine("Hello, World!");
rich@M1 ~ % cat console/console.csproj 
<Project Sdk="Microsoft.NET.Sdk">

<!--
See https://aka.ms/new-console-template for more information
on the new .NET 6 templates.
-->

  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>net6.0</TargetFramework>
    <ImplicitUsings>enable</ImplicitUsings>
    <Nullable>enable</Nullable>
  </PropertyGroup>

</Project>

As an aside, there is no mention of async at https://aka.ms/new-console-template. That’s probably a missed opportunity that IMO helps motivate the move to top-level statements.

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:8 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
richlandercommented, Mar 30, 2022

More ideas:

dotnet inspect foo.dll

It tells you (among other things) which TFM and/or RIDs the binary targets/supports.

dotnet inspect foo.npkg

It tells you (among other things) author, publish date, and dependencies.

This is probably a good project to start and then we can decide if we should integrate it into the SDK or leave it as a .NET tool.

0reactions
richlandercommented, Mar 25, 2022

We didn’t design for self-help. We’d have to intentionally design the UX we want and then augment the product to deliver it.

The dotnet list direction looks good. We’d also want a variant that was a complete spew of data to be used for support purposes. This is the analog to docker inspect (which I use a fair bit). docker inspect works the opposite direction. It starts with a huge bag of data and then enables various experiences for chopping it down to what you want. I think that’s the “better way”. It prioritizes richness of data over experience and then transitions the discussion away from fidelity to UX.

Read more comments on GitHub >

github_iconTop Results From Across the Web

dotnet command - .NET CLI
Runs the application from source. dotnet sdk check, Shows up-to-date status of installed SDK and Runtime versions. dotnet sln, Options to add, ...
Read more >
dotnet test command - .NET CLI
The dotnet test command is used to execute unit tests in a given project. ... TestAdapter.dll are inspected. If not specified, the directory ......
Read more >
dotnet-dump diagnostic tool - .NET CLI
The dotnet-dump global tool is a way to collect and analyze dumps on Windows, Linux, and macOS without any native debugger involved.
Read more >
Inspect assembly contents using MetadataLoadContext
This sample is a .NET console application that loads a specified assembly and prints its custom attributes and defined types.
Read more >
dotnet-sos diagnostic tool - .NET CLI
Learn how to install and use the dotnet-sos CLI tool to manage the SOS debugger extension, which is used with native debuggers on...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found