microsoft / microsoft/component-detection

Add support for `dotnet run` project metadata

Open
#1,383 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

detector:nuget
Dominant language
C#
Stars
553
Forks
135
Avg merge
20h 58m
Merged PRs (30d)
6

Description

The .NET team is proposing a new `dotnet run file.cs` command, which allows running single C# files, without a backing project. As part of that, NuGet dependencies can be specified as comments. For example:

```
#:sdk Microsoft.NET.Sdk.Web
#:property TargetFramework net11.0
#:property LangVersion preview
#:package System.CommandLine 2.0.0-*
```

Component Detection should be able to detect and register these dependencies.

References:
- https://github.com/dotnet/sdk/blob/main/documentation/general/dotnet-run-file.md#directives-for-project-metadata
- https://github.com/dotnet/csharplang/blob/main/proposals/ignored-directives.md

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked dotnet-run-file documentation and ignored-directives proposal to understand the supported metadata and comment syntax. Trace the existing Component Detection handling for C# project dependencies, then verify that the SDK, properties, and package directives in the issue are detected and registered.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
devtools
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.