Skip to content

Add dotnet new templates for nanoFramework (nanoapp and nanolib) #1796

Open

Description

@danielmeza

Description

There is no dotnet new template for nanoFramework SDK-style projects. The tooling spec lists templates as a Phase 1 (minimum viable SDK) component (C7): a nanoapp template for applications and a nanolib template for libraries, so a developer can scaffold a working SDK-style project from the command line (and from the IDE template pickers that surface dotnet new templates). Today there is no first-class way to create a new SDK-style project; the only paths are hand-writing the .csproj or migrating an existing legacy project.

How to solve the problem

Ship a nanoFramework.Templates package with two templates, per the tooling spec:

  • nanoapp — an application: <Project Sdk="nanoFramework.NET.Sdk">, netnano1.0, OutputType=Exe, a Program.cs with a minimal sample, and the template metadata (shortName: nanoapp, sourceName).
  • nanolib — a library variant: OutputType=Library, packing metadata stubbed, no Program.cs.

Both should produce a project that restores and builds against the published SDK, and pin the SDK via global.json where appropriate.

Acceptance: dotnet new nanoapp -n X && cd X && dotnet build succeeds end-to-end against the published SDK; dotnet new nanolib -n Y produces a library that builds and packs.

Describe alternatives you've considered

  • Rely on migrating an existing project or copying a sample. Rejected: there is no supported "new project" experience, which is a basic expectation and is needed by both the CLI and the IDE template pickers.
  • Bundle templates inside the SDK package. Possible, but the spec calls for a separate template package (C7); a dedicated package is the conventional dotnet new distribution and keeps SDK and templates versioned independently.

Additional context

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions