Skip to content

Add NuGet.config support for .NET testing #148

@rshade

Description

@rshade

Background

The recent .NET/C# support implementation (#147) provides core functionality for testing .NET Pulumi programs, including:

  • Local project references via DotNetReference()
  • Build configuration control via DotNetBuildConfiguration()
  • Target framework specification via DotNetTargetFramework()

Enhancement Request

Add support for custom NuGet configuration to enable testing with private NuGet feeds and custom package sources.

Proposed Features

  1. Custom NuGet Feed Support

    • Option to specify custom NuGet package sources
    • Support for authenticated feeds
  2. NuGet.config Path Specification

    • DotNetNuGetConfig(path) option to specify a custom NuGet.config file
    • Path should support both absolute and relative paths
  3. Auto-detection

    • Automatically detect and use NuGet.config if present in project directory
    • Respect NuGet.config hierarchy (project → solution → user → machine)

Use Cases

  • Testing with packages from private/internal NuGet feeds
  • CI/CD environments with custom package sources
  • Development workflows using local package caches
  • Testing pre-release packages from custom feeds

Implementation Considerations

  • Follow existing patterns from YarnLink and GoModReplacement
  • Text-based manipulation or environment variable approach similar to MSBuild Configuration
  • Consider using NUGET_PACKAGES environment variable for custom package cache locations
  • May need to handle authentication via environment variables or config

Priority

Low - Not critical for most current use cases, but would be valuable for teams using private NuGet feeds.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions