Skip to content

Add DotNetTargetFramework option for .NET testing #155

@rshade

Description

@rshade

Hello!

  • Vote on this issue by adding a 👍 reaction
  • If you want to implement this feature, comment to let us know (we'll work with you on design, scheduling, etc.)

Issue details

Add DotNetTargetFramework option to allow tests to override the target framework specified in .csproj files.

Use Cases

  • Testing SDK compatibility across multiple .NET versions without maintaining separate test projects
  • CI matrix testing across frameworks (net6.0, net7.0, net8.0, etc.)
  • Validating that a locally-built SDK works with different framework versions

Proposed API

test := NewPulumiTest(t,
    "path/to/csharp/project",
    opttest.DotNetTargetFramework("net7.0"),
)

Implementation Notes

  • Would modify <TargetFramework> element in .csproj during test setup
  • Requires corresponding .NET SDK to be installed on the test machine
  • NuGet packages must be compatible with the specified framework
  • Test projects should typically specify their framework in .csproj

Priority

Low - test projects should typically specify their framework; framework testing is better handled via separate test projects or CI matrix

Affected area/feature

.NET/C# Testing

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions