Skip to content

Docs: Dev Tunnels "Configure dev tunnel options" examples do not compile; options table omits Region #1465

Description

Page

integrations/devtools/dev-tunnels → "Configure dev tunnel options" and "Configuration → Dev tunnel options".

Source: dev-tunnels.mdx

Problem 1 — C# example does not compile

var options = new DevTunnelOptions
{
    TunnelId = "my-tunnel-id",              // not a DevTunnelOptions member
    Description = "QA environment tunnel",
    Labels = new[] { "qa", "testing" },     // string[] not assignable to List<string>?
    AllowAnonymous = false
};

var tunnel = builder.AddDevTunnel("qa", options)   // options bound to `string? tunnelId`
                    .WithReference(web);

Verified against DevTunnelOptions.cs — the members are Description, AllowAnonymous, Labels (List<string>?), and Region; there is no TunnelId — and DevTunnelResourceBuilderExtensions.csAddDevTunnel(string name, string? tunnelId = null, DevTunnelOptions? options = null).

Three issues:

  1. TunnelId is not a member of DevTunnelOptions. It is a parameter of AddDevTunnel (and a property of DevTunnelResource).
  2. Labels = new[] { "qa", "testing" } assigns a string[] to a List<string>? property, which does not compile.
  3. builder.AddDevTunnel("qa", options) passes a DevTunnelOptions into the string? tunnelId positional parameter.

Correct:

var options = new DevTunnelOptions
{
    Description = "QA environment tunnel",
    Labels = ["qa", "testing"],
    AllowAnonymous = false
};

var tunnel = builder.AddDevTunnel("qa", tunnelId: "my-tunnel-id", options: options)
                    .WithReference(web);

Problem 2 — TypeScript example passes an options object the export does not accept

The exported polyglot API is addDevTunnel(name, tunnelId?, allowAnonymous?, description?, labels?) — from AddDevTunnelForPolyglot, annotated [AspireExport("addDevTunnel")] in DevTunnelResourceBuilderExtensions.cs. It takes positional parameters, not a { tunnelId, description, labels, allowAnonymous } object. The documented TypeScript call:

const tunnel = await builder.addDevTunnel("qa", {
    tunnelId: "my-tunnel-id",
    description: "QA environment tunnel",
    labels: ["qa", "testing"],
    allowAnonymous: false,
}).withReference(web);

does not match the exported signature (and tunnelId is not a nested option in either language).

Problem 3 — options table omits Region

The "Dev tunnel options" table lists only Description, Labels, and AllowAnonymous, but DevTunnelOptions also exposes Region (DevTunnelRegion?, an enum of ~13 regions). Note that the exported TypeScript addDevTunnel does not surface Region, so if the table documents Region, it should note the C#-only scope.

Provenance

aspire.dev release/13.5 (dev-tunnels.mdx); aspire release/13.5 (DevTunnelOptions.cs, DevTunnelResourceBuilderExtensions.cs). Compile behavior confirmed against the 13.5 candidate.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions